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 billows at 2007-07-11 11:11:16 on Problem 1006
#include<iostream>
#include<list>
using namespace std;
int main()
{
    int a,b,c,d,i=1;
	list< int > v;
	while(true)
	{
		cin>>a>>b>>c>>d;
		
		if(a==-1) break;
		v.push_back(a%23);
		v.push_back(b%28);
		v.push_back(c%33);
		v.push_back(d);
	}
    while(!v.empty())
	{
		
		a=v.front();
		v.pop_front();
		b=v.front();
		v.pop_front();
		c=v.front();
         v.pop_front();
		d=v.front();
		v.pop_front();
		int e=d;
		while(true)
		{
			
			d=d+1;
			if((d-a)%23==0&&(d-b)%28==0&&(d-c)%33==0)
				break;
		}
		cout<<"Case "<<i<<": the next triple peak occurs in"<<d-e<<"day."<<endl;
		i=i+1;
	}
	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