- js27108 的博客
判断质数
- @ 2026-2-1 10:21:11
#include<bits/stdc++.h>
using namespace std;
bool sb(int a){
if(a<2){
return 0;
}
for(int i=1;i<sqrt(a);i++){
if(a%i==0){
}
}
return 0;
}
int main(){
int y;
cin>>y;
if(sb(y)){
cout<<"是";
}else{
cout<<"不是";
}
return 0;
}