标签:miss div inpu sqrt std problem other rip scan
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768
K (Java/Others)
Total Submission(s): 25897 Accepted Submission(s): 11321
30 26 0
3 2
#include<stdio.h>
#include<math.h>
int f(int x)
{
int i;
for(i=2;i<=sqrt(x);i++)
if(x%i==0)
return 0;
return 1;
}
main()
{
int a,b,i,l,n,m;
while(scanf("%d",&n)&&n!=0)
{
l=0;
for(i=2;i<n-i;i++)
if(f(i)&&f(n-i))
l++;
printf("%d\n",l);
}
return 0;
}
标签:miss div inpu sqrt std problem other rip scan
原文地址:http://www.cnblogs.com/ljbguanli/p/6798551.html