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

PROGRAMMING:Finding prime numbers within 100

Luz5年前 (2021-05-10)题库466
Find all prime numbers within 100 and output 10 per line. A prime is a positive integer that can only be divided by 1 and itself. 1 is not a prime, 2 is a prime. It is required to define and call the function prime (m) to judge whether M is a prime. When m is a prime, it returns 1, otherwise it returns 0.
###Input format:
No input data
###Output format:
Output prime numbers within 100, output 10 per line, prompt: you can use the output statement printf (% 6D ", m) to control the output interval between prime numbers.
###Input example:
```in
```
###Output example:
```out
2 3 5 7 11 13 17 19 23 29
31 37 41 43 47 53 59 61 67 71
73 79 83 89 97
```







answer:If there is no answer, please comment