题解
2025-05-28 19:24:36
发布于:浙江
0阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,p;
cin>>a;
for(int i=2;i<=a;i++){
p=0;
for(int j=2;j<=sqrt(i);j++){
if(i%j==0)
p++;
}
if(p==0)
cout<<i<<" ";
}
return 0;
}
这里空空如也
有帮助,赞一个