1.给出start与end;
2.有数i,遍历start~end中的素数;
3.输出;
#include <iostream>
#include<cmath>
using namespace std;
int main(void){
int m,n;
int flag;
printf("请输入start,end:\n");
scanf("%d %d",&m,&n);
for(int i=m;i<=n;i++){
flag=1;
for(int j=2;j<=sqrt(i);j++){
if(i%j==0){flag=0;}
}
if(flag){printf("%d ",i);}
}
return 0;
}
标签:39,end,int,flag,start,素数,printf,day From: https://www.cnblogs.com/drz1145141919810/p/17435309.html