| ||||||||||
| 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;
int a , b , c , k = 0 ;
while(cin>> p>> e>> i>> d && d < 365 && d >= 0)
{
if(p == -1 && e == -1 && i == -1 && d == -1 ) break;
k++;
for(int j = 1 ; j <= 21252 ; j++)
{
a = ( j - p ) % 23 ;
b = ( j - e ) % 28 ;
c = ( j - i ) % 33 ;
if(a == 0 && b == 0 && c == 0 )
{
cout<< "Case " << k << ": the next triple peak occurs in " << j - d << " days." << endl;
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