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