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 |
Re:蛋疼的题目描述。。。直接暴力就过了……In Reply To:蛋疼的题目描述。。。直接暴力就过了…… Posted by:wuxiangyu at 2011-12-27 23:29:02 > #include <iostream> > using namespace std; > int p, e, i, d, t, n=0; > int main() > { > while (cin>>p>>e>>i>>d, p!=-1){ > for (n++,t=d+1; t<=d+21252; t++) > if ((t-p)%23==0 && (t-e)%28==0 && (t-i)%33==0) break; > printf("Case %d: the next triple peak occurs in %d days.\n", n, t-d); > } > return 0; > } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator