| ||||||||||
| 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 | |||||||||
测试都过了的 ,但总是WR?why 求解#include <stdio.h>
int main()
{ int p,e,i,d,j,y;
y=1;
while(scanf("%d%d%d%d",&p,&e,&i,&d)!=EOF){
if(p==-1&&e==-1&&i==-1&&d==-1) break;
j=d;
if(j<p)
j=p;
if(j<e)
j=e;
if(j<i)
j=i;
while((j-p)%23!=0)
j++;
if(j==0)
{printf("Case %d: the next triple peak occurs in 21252 days.\n",y);y++;continue;}
for(;j<=21252;j+=23)
if((j-e)%28==0)
for(;j<=21252;j+=23*28)
if((j-i)%33==0)
{printf("Case %d: the next triple peak occurs in %d days.\n",y,j-d);y++;}
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator