标签:cep ios java ott 数据 || col time sub
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 191485 Accepted Submission(s): 67558
1 #include<iostream> 2 using namespace std; 3 int is_su(int n) 4 { 5 int i; 6 for(i=2;i<=n/2;i++) 7 { 8 if(n%i==0)return 0; 9 } 10 return 1; 11 } 12 int main() 13 { 14 int m,i,value,a,b; 15 while(cin>>a>>b&&(a!=0||b!=0)) 16 { 17 m=1; 18 for(i=a;i<=b;i++) 19 { 20 value=i*i+i+41; 21 if((!is_su(value))||value<2) 22 { 23 m=0; 24 break; 25 } 26 } 27 if(m==1)cout<<"OK"<<endl; 28 else cout<<"Sorry"<<endl; 29 } 30 return 0; 31 }
标签:cep ios java ott 数据 || col time sub
原文地址:https://www.cnblogs.com/lightice/p/10261132.html