-->
当前位置:首页 > 题库

PROGRAMMING:Determine whether an integer is a prime

Luz5年前 (2021-05-10)题库450
This problem requires the preparation of procedures to determine whether a given integer is a prime number. A prime is a positive integer that can only be divided by 1 and itself. 1 is not a prime, 2 is a prime.
###Input format:
Enter an integer $$M $$($- 2 ^ {31} Le M / le 2 ^ {31} - 1 $$) to be judged in one line.
###Output format:
If $$M $$is a prime, output 'yes' in one line, otherwise output' no '. If you enter a non positive integer, you should also output 'no'.
###Input sample 1:
```in
eleven
```
###Output sample 1:
```out
Yes
```
###Input sample 2:
```in
nine
```
###Output sample 2:
```out
No
```
###Input sample 3:
```in
-2
```
###Output sample 3:
```out
No
```






answer:If there is no answer, please comment