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

Re:帮忙看一看那里错了。谢谢!

Posted by victry at 2004-01-05 18:40:43 on Problem 1006
In Reply To:帮忙看一看那里错了。谢谢! Posted by:wlei629 at 2003-08-29 09:48:06
> 
> 	#include<stdio.h>
> 
> 	int main()
> 	{
> 		int p, e, i, d;
> 		int j, days, x;
> 
> 		scanf( "%d%d%d%d", &p, &e, &i, &d );
> 		j = 0;
> 		while( p != -1 || e != -1 || i != -1 || d != -1 )
> 		{
> 			j++;
> 			for( x = 0; x <= 21252; x++ )
> 			{
> 				if( x > d && x > p && x > e && x > i && (x-p)%23 == 0 && (x-e)%28 == 0 && (x-i)%33 == 0 )
> 				{
> 					days = x-d;
> 					break;
> 				}
> 			}
> 			if( x >21252 )
> 				days = 21252-d;
> 			printf( "Case %d: the next triple peak occurs in %d days.\n", j, days );
>             		scanf( "%d%d%d%d", &p, &e, &i, &d );
> 		}
> 	}

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