| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
我的方法简单不#include<iostream>
using namespace std;
int main()
{
int p,e,i,d,num=0;
while(cin>>p>>e>>i>>d && p!=-1 &&e!=-1 &&i!=-1 &&d!=-1)
{
num++;
while((p-e)%28!=0 || (p-i)%33!=0)
p+=23;
while(p-d<=0)
p+=21252;
while(p-d>21252)
p-=21252;
cout<<"Case "<<num<<": the next triple peak occurs in "<<p-d<<" days."<<endl;
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator