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