标签:des style blog color io java strong for 数据
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 74351 Accepted Submission(s):
25941
1 #include<cstdio> 2 #include<cmath> 3 int main() 4 { 5 int x,y; 6 while(scanf("%d%d",&x,&y)!=EOF) 7 { 8 if(x==0&&y==0)return 0; 9 if(x>y)return 0; 10 if((x<-39&&x>50)||(y<-39&&y>50))return 0; 11 int flag=1; 12 for(int i=x;i<=y&&flag;i++) 13 { 14 int k=i*i+i+41; 15 for(int j=2;j<=sqrt(k)&&flag;j++) 16 if(k%j==0)flag=0; 17 } 18 if(flag)printf("OK\n"); 19 else printf("Sorry\n"); 20 } 21 return 0; 22 }
标签:des style blog color io java strong for 数据
原文地址:http://www.cnblogs.com/The-courage-that-year/p/3992472.html