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