标签:space string name lse for sqrt std out end
#include <iostream> #include <string.h> #include <cmath> using namespace std; int main() { int m,n,count=0,w=0,c = 0; cin>>m>>n; for(int i=2;i<500000;i++) { w=0; for(int j=2;j<=sqrt(i);j++) { if(i%j==0) { w=1; break; } } if(w==0) { count++; if(count>=m&&count<=n) { cout<<i; c++; if(c%10==0) cout<<endl; else if(c%10!=0&&count<n) cout<<" "; } } } return 0; }
标签:space string name lse for sqrt std out end
原文地址:https://www.cnblogs.com/QRain/p/12221329.html