| ||||||||||
| 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 | |||||||||
怎么测试数据都过了,下面的特殊数据也过了,但就是说wrong answer呢?#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)
{
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