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 |
为什么所以测试数据包括特殊的数据都通过了,就是wa,谁能帮我看看,帮我解答#include"stdio.h" int main() { int p,e,i; int d; int j=1; int n; while(scanf("%d %d %d %d",&p,&e,&i,&d)==4) { t=0; if(i==-1&&p==-1&&e==-1&&d==-1) return 0; n=0; if(p>23) p=p%23; if(e>28) e=e%28; if(i>33) i=i%33; while(n<21252) { if((n%23==p)&&(n%28==e)&&(n%33==i)) { if(n-d<=0) printf("Case %d: the next triple peak occurs in %d days.\n",j,n-d+21252); else printf("Case %d: the next triple peak occurs in %d days.\n",j,n-d); break; } else n++; } j++; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator