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