| ||||||||||
| 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 | |||||||||
谁知道为什么我这个是WA(1006)#include <stdio.h>
int main()
{
long int num,p,e,i,d;
num=0;
while(scanf("%ld %ld %ld %ld",&p,&e,&i,&d)!=EOF)
{
if(p==-1&&e==-1&&i==-1&&d==-1)
break;
num++;
while(1)
{
i+=33;
if((i-e)%28==0&&(i-p)%23==0)
{
if(i!=d)
{
printf("Case %ld: the next triple peak occurs in %ld days.\n",num,i-d);
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