【入门】判断质数
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Description
质数是指除了1和本身之外没有其他约数的数,如7和11都是质数,而6不是质数,因为6除了约数1和6之外还有约数2和3。输入一个正整数,判断它是否为质数,如是质数则输出“Yes”,否则输出这个数的大于1的最小的约数。
Input Format
仅有一行包含一个正整数n,其中 1 < n < 1000000。
Output Format
仅有一行,如果从输入文件读入的数是质数则输出“Yes”,否则输出这个数的大于1的最小的约数。
2009
7
Source
简单循环
课后练习3(循环结构)
- Status
- Done
- Problem
- 6
- Open Since
- 2025-12-13 0:00
- Deadline
- 2025-12-20 23:59
- Extension
- 24 hour(s)