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 catoran at 2005-06-12 13:14:35 on Problem 1006
#include<stdio.h>
void main(){
	int p,e,i,d;
	int count,data;

	count=0;

	while(1){
		
		scanf("%d%d%d%d",&p,&e,&i,&d);
		count++;

		if(p==-1&&e==-1&&i==-1&&d==-1)    break;

		else{
			
			for(data=1;;data++){
				if((data+23-p%23)%23==0&&(data+28-e%28)%28==0&&(data+33-i%33)%33==0){
					printf("Case %d: the next triple peak occurs in %d days.\n",count,data-d);
					break;
				}
			}
		}
	}
}

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