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

1006测试数据都通过了,怎么不对?

Posted by wwx1987wwx at 2006-07-28 23:16:44
#include<stdio.h>
int main()
{
	int d1,d2,d3,d4;
	int n1,n3,i=1;
	int x,z;
	int fin;
	scanf("%d %d %d %d",&d1,&d2,&d3,&d4);
	while(d1!=-1||d2!=-1||d3!=-1)
	{    
		 n1=d2-d1;
		 n3=d3-d1;
	     x=1;
		 while((n1-23*x)%28!=0)
		 {
			 x++;
		 }	 
	
		 z=1;
		 while((n3-23*x+33*z)%644!=0)
		 {
			 z++;
			
			
         }
         fin=33*z+n3+d1-d4;
		 printf("Case %d: the next triple peak occurs in %d days.\n",i,fin);
		 scanf("%d %d %d %d",&d1,&d2,&d3,&d4);
		 i++;
	}
	return 0;
}

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