| ||||||||||
| 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 | |||||||||
我的怎么还是不行啊?In Reply To:通过了,一点经验 Posted by:saintguang at 2008-04-08 14:04:23 #include<stdio.h>
int main()
{
int p,e,i,d,c,j;
for(c=0;;c++)
{
scanf("%d %d %d %d",&p,&e,&i,&d);
if(d==-1)
break;
for(j=d;;j++)
{
if((j-p)%23==0&&(j-e)%28==0&&(j-i)%33==0&&(j-p)!=0&&(j-e)!=0&&(j-i)!=0)
{
if((j-d)!=0&&(j-d)<=21252)
{
printf("Case %d: the next triple peak occurs in %d days.\n",c+1,j-d);
break;
}
else
{
printf("Case %d: the next triple peak occurs in 21252 days.\n",c+1);
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