//土尔逊Torson 编写于2023/5/08 #define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <cstdio> #include <math.h> using namespace std; bool Judge(int x) { //判断是否为质数(素数) if (x < 2) { //小于2必定不是 return false; } int bound = sqrt(x); //确定判定上界 for (int i = 2; i <= bound; ++i) { if (x%i == 0) { return false; } } return true; } int main() { int n; while (scanf("%d", &n) != EOF) { if (Judge(n)) { printf("yes\n"); } else { printf("no\n"); } } system("pause"); return EXIT_SUCCESS; } // 64 位输出请用 printf("%lld")