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 |
所有测试用例答案都对,可是一直wa;帮帮忙啊,郁闷呀#include <iostream> using namespace std; int main() { int p,e,i,d,t; int m; int num=0; while(1) { num++; t=-1; scanf("%d%d%d%d",&p,&e,&i,&d); if(p==-1 && e==-1 && i==-1 && d==-1) break; while(1) { t++; m=(d+t)%365; if((d+t-p)%23==0&&(d+t-e)%28==0&&(d+t-i)%33==0) { if(d==m) continue; else printf("Case %d: the next triple peak occurs in %d days.\n",num,t); break; } } } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator