在杭电刷题2012出现wrong answer的情况,请各位帮个忙
#include<stdio.h>#include<math.h>
int main()
{
signed int x,y,i,k,j;
signed int place,flag;
while(scanf("%d%d",&x,&y)!=EOF)
{
place=0; flag=0;
if(x==0&&y==0) break;
for(i=x;i<=y;i++)
{
k=i^2+i+41;
for(j=2;j<sqrt(k);j++)
{
if(k%j!=0) flag=1;
else flag=0;
}
if(flag==1) place++;
}
if(place==(y-x+1)) printf("OK\n");
else printf("Sorry\n");
}
return 0;
}