| ||||||||||
| 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?#include"stdio.h"
void main()
{int p[1000],e[1000],i[1000],d[1000],s;
int j,k,n,m;
scanf("%d",&n);
for(j=0;j<n;j++)
scanf("%d %d %d %d",&p[j],&e[j],&i[j],&d[j]);
for(j=0;j<n;j++)
{if(p[j]>=0&&e[j]>=0&&i[j]>=0&&d[j]>=0)
{for(k=1;;k++)
{s=p[j]+23*k;
if((s-e[j])%28==0&&(s-i[j])%33==0)
break;
}
m=s-d[j];
if (m>23*28*33) m=m-23*28*33;
printf("Case %d : the next triple peak occurs in %d days.\n",j+1,m);
}
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator