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