Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
谁帮我看看这代码哪错了#include<stdio.h> int main() { int m,sum,n,a,b; while(scanf("%d",&m),m) { a=0;b=0; sum=0; for(int i=2;i<=m/2;i++) { n=m-i; for(int j=2;j<i;j++) { if(i%j==0) { a=1;break; } } for(int j=2;j<n;j++) { if(n%j==0) { b=1;break; } } if(a==0&&b==0) sum++; } printf("%d\n",sum); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator