Problem Description
对于表达式n^2+n+41,当n在(x,y)范围内取整数值时(包括x,y)(-39<=x
#include<stdio.h>
int SuShu(int n){
int i;
for(i=2;i<=n/2;i++){
if(n%i==0)
break;
}
if(n!=1&&i>n/2)
return 1;
else
return 0;
}
int main(){
int x,y,num,j;
while(scanf("%d%d",&x,&y)!=EOF&&(x!=0||y!=0)){
for( j=x;j<=y;j++){
num=j*j+j+41;
if(SuShu(num)==0)
break;
}
if(j>y)
printf("OK\n");
else
printf("Sorry\n");
}
return 0;
}