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 hubo430 at 2005-05-10 16:58:06 on Problem 1006
#include<iostream.h>

#include<stdio.h>

void main()
{
	int shengti,qinggan,zili,data1,number=0;

	while(scanf("%d%d%d%d",&shengti,&qinggan,&zili,&data1)==4)

	{
		if(shengti==-1&&qinggan==-1&&zili==-1&&data1==-1) break;

		number++;

		int data2=zili,data;

		while(1)

		{
			if((data2-shengti)%23==0&&(data2-qinggan)%28==0) break;

			data2=data2+33;

		}

		data=data2-data1;

		if(data<=0) data=data+21252;

		printf("Case %d: the next triple peak occurs in %d days.\n",number,data);

	}

}

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