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