文章
81
粉丝
0
获赞
282
访问
11.0k
#include<bits/stdc++.h>
using namespace std;
int i;
bool shu(int x){
for(i=2;i<=sqrt(x);i++){
if(x%i==0){
return false;
}
}
return true;
}
int main(){
int n1,n2,j,index=0;
cin>>n1>>n2;
for(j=n1;j<=n2;j++){
if(shu(j)){
cout<<j<<" ";
index++;
if(index==5){
cout<<endl;
index=0;
}
}
}
}
登录后发布评论
暂无评论,来抢沙发