1027: Makeup Exam: Problem 1
Memory Limit:128 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:311
Solved:27
Description
Show all the prime numbers less than or equal to an integer N obtained from keyboard. The output are numbers placed in descending order. The numbers are separated comma without any spaces and end with a comma. For example, if N=20, the output is
19,17,13,11,7,5,3,2,
Input
20
Output
19,17,13,11,7,5,3,2,
Sample Input Copy
30
Sample Output Copy
29,23,19,17,13,11,7,5,3,2,
HINT
You can write a function to identify whether an integer is a prime number or not.