0
已解决
题目链接: 酷丁编程:9841
#include<bits/stdc++.h>
using namespace std;
long long n,m,cnt,sum,x;
bool t[10000005];
int main(){
cin>>x;
while(x--){
cin>>m>>n;
for(int i=2;i<=sqrt(n);i++){
if(!t[i]){
for(int j=i*2;j<=n;j+=i){
t[j]=1;
}
}
}
for(int i=m;i<=n;i++){
if(!t[i]){
cout<<i<<' ';
cnt++;
}
}
if(!cnt){
cout<<-1;
}
cout<<'\n';
}
return 0;
}
为什么只有70分?
