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 kelven at 2006-05-28 13:16:00 on Problem 1006
#include <iostream>
using namespace std;
int  main(){
int days[1000];int num=0;
int a,b,c,d;
while(cin>>a>>b>>c>>d)
{
if(a==-1&&b==-1&&c==-1&&d==-1)
break;
else
{
	do{
if(a<=b&&a<=c)
a+=23;
else if(b<=a&&b<=c)
b+=28;
else if(c<=b&&c<=a)
c+=33;
	}while(a!=b||a!=c);
days[num]=a-d;
num++;
}}
for(int i=0;i<num;i++)
cout<<"Case "<<(i+1)<<": the next triple peak occurs in "<<days[i]<<" 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