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 wushengdexiao at 2009-07-05 20:59:58 on Problem 1006
In Reply To:管他什么中国剩余定理不定理的,超级简单 Posted by:xiaoyu0720 at 2009-06-14 21:19:23
> //poj1006
> #include<iostream> 
> using namespace std; 
> int main() 
> { 
> int a,p,e,i,d,j=0; 
> 	while(cin >>p>>e>>i>>d &&( p !=-1||e !=-1||i !=-1||d !=-1)) 
> 	{
> 		for(a =21252; a >= 0;a--) 
> 		{ 
> 			if( (a+d-p)%23==0&&(a+d-e)%28==0&&(a+d-i)%33==0)break; 
> 			else continue; 
> 		} 
> 		j++; 
> 		cout <<"Case " <<j<<": the next triple peak occurs in " <<a<<" days."<<endl; 
> 	}
> 	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