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 minefield at 2006-12-02 17:11:01 on Problem 1006
#include <stdio.h>

int result (int b1,int b2,int b3,int b4)
{		
	while ((b1 - b2) % 28 || (b1 - b3) % 33 ||(b1 - b4) <= 0)
	{		
		b1 += 23;
	}
	return b1-b4;
}

int main (void)
{
	int a,b,c,d,i=1;
	scanf("%i%i%i%i",&a,&b,&c,&d);
	while(a !=-1 || b !=-1 || c !=-1 || d !=-1)
	{	
		printf("Case %i: the next triple peak occurs in %i days.\n",i++,result (a,b,c,d));
		scanf("%i%i%i%i",&a,&b,&c,&d);
	}
	
	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