CPZT ACGO
2024-02-18 20:16:02
发布于:辽宁
5阅读
0回复
0点赞
点个关注!
#include <iostream>
using namespace std;
int sushu(int N) {
int sum = 1;
if (N < 2) {
sum = 0;
}else if (N <= 2 && N > 1) {
sum = 1;
}else {
for (int i = 3;i < N;i++) {
if (N % i == 0) {
sum = 0;
break;
}
}
}
return sum;
}
int main() {
int N;
cin >> N;
int sum = sushu(N);
if (sum == 0) {
cout << "No";
}else {
cout << "Yes";
}
return 0;
}
这里空空如也
有帮助,赞一个