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