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 90401307 at 2004-11-29 15:13:26 on Problem 1006
In Reply To:帮我看看吧!谢谢了 Posted by:90401307 at 2004-11-29 15:13:16
#include<stdio.h>
int main(){
	int a,b,c,d,p,i;
	i=0;
	scanf("%d%d%d%d",&a,&b,&c,&d);
	while(a!=-1&&b!=-1&&c!=-1&&d!=-1){
		i++;
		for(p=1;p<=21252;p++){
			if((p-a)%23==0&&(p-b)%28==0&&(p-c)%33==0)
				printf("Case %d: the next triple peak occurs in %d days.\n",i,p-d);
		}
	scanf("%d%d%d%d",&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