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