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 heiheigo at 2005-07-10 11:43:50 on Problem 1006
In Reply To:续同样的程序不一样的结果?原来GCC时间快这么多?377MS 和900多MS GCC VS C? Posted by:heiheigo at 2005-07-10 11:39:35
#include "stdio.h"
int main(){
	int p,e,i,d;
	int j=1;
	int k=0;
	long r;
	while(scanf("%d%d%d%d",&p,&e,&i,&d)){
		if(p==-1)
			break;
		while(1){	
		     r=p+k*23;
			if((r-e)%28==0&&(r-i)%33==0){
				r=r-d;
				if(r<=0)
					r+=21252;
				break;
			}
			k++;			
		}
		printf("Case %d: the next triple peak occurs in %ld days.\n", j, r);
		j++;
		k=0;
	}
	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