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() { long p,e,i,d,count=0,day,t; scanf("%d%d%d%d",&p,&e,&i,&d); while(p!=-1&&e!=-1&&i!=-1&&d!=-1) { count++; while(1) { if(p<=e&&p<=i) p=p+23; else if(e<=p&&e<=i) e=e+28; else i=i+33; if(p==e&&p==i) break; } t=(p-d-1)/21252; day=p-d-t*21252; printf("Case %d: the next triple peak occurs in %d days.\n",count,day); scanf("%d%d%d%d",&p,&e,&i,&d); } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator