Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

哪位大哥帮忙看看,我用题目的数据可以通过但提交就不行了!

Posted by shan582 at 2004-10-03 22:12:24 on Problem 1006
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator