| ||||||||||
| 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:求助大神,为什么讨论里所有数据都能过,还是WA呢?In Reply To:求助大神,为什么讨论里所有数据都能过,还是WA呢? Posted by:legendry at 2015-04-25 23:14:15 > #include<iostream>
> #include<cstdio>
> using namespace std;
> int p,e,i,d,n;
> int main()
> {
> int j=0;
> while(scanf("%d%d%d%d",&p,&e,&i,&d)==4&&(p+e+i+d)!=-4)
> {
> j++;
> n=i;
> while(n<=21252+d)
> {
> if(n<=d){
> n=n+33;
> continue;
> }
> else if((n-p)%23==0&&(n-e)%28==0){
> break;
> }
> else n=n+33;
> }
> printf("Case %d: the next triple peak occurs in %d days.\n",j,n-d-21252>0?(n-d)%21252:(n-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