| ||||||||||
| 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;
void main(){
int p,e,i,d,x,k,num=1;
while(1){
cin>>p>>e>>i>>d;
if(p==-1 && e==-1 && i==-1 && d==-1) break;
for(x=d+1;x<=21252;x++)
if((x-p)%23==0) break;
for(;x<=21252;x+=23)
if((x-e)%28==0) break;
for(;x<=21252;x+=23*28)
if((x-i)%33==0) break;
k=x-d;
cout<<"Case "<<num<<":";
cout<<"the next triple peak occurs in "<<k<<" days"<<endl;
num++;
}
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator