题解 | #牛牛的素数判断#
牛牛的素数判断
http://www.nowcoder.com/practice/81c8387f72824cceb5c955e3dbfd2882
int main() {
int n, m = 0;
while (scanf("%d", &n) != EOF) {
m++;
if (m != 1) {
int count = 0;
for (int i = 1; i <= n; i++) {
if (n % i == 0) count++;
}
if (count == 2) printf("true\n");
else printf("false\n");
}
}
return 0;
}