Prime number
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
The program receives a natural number n where n is greater than 1. Your task is to determine if this number is prime, meaning it should only be divisible by 1 and n itself.
Input
A natural number n (1 < n < 2^31
).
Output
Print 1 if the number n is prime, and 0 if it is not.
Examples
Input #1
Answer #1
Input #2
Answer #2
Submissions 7K
Acceptance rate 32%