| ||||||||||
| 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 | |||||||||
这个哪里错了啊?~~~ 测试都没有问题的阿~~竟然告诉我 Wrong Answer#include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<int> days;
int a, b, c, d, x, y, i = 0;
while(++i){
cin >> a >> b >> c >> d;
if(a == b && b == c && c == d && d == -1)
break;
x = y = 1;
while(((23 * x - b + a) % 28))
++x;
while(((23 * 28 * y + 23 * x - c + a) % 33))
++y;
days.push_back(23 * 28 * y + 23 * x - d + a);
}
for(int j = 0; j < i - 1; j++)
cout << "Case " << j + 1 << ": the next triple peak occurs in "
<< days[j] << " days." << endl;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator