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 n = 0; int j = 1; while( 1 ) { cin >> p >> e >> i >> d; if( p == -1 && e == -1 && i == -1 && d == -1 ) break; n = ( p * 5544 + e * 14421 + i * 1288 + 21252 ) % 21252 - d; if(!n) n = 21252; cout << "Case " << j++ << ": the next triple peak occurs in " << n << " days." << endl; } return 0; } 我看了下楼上的那个人的代码,它的代码是 #include <iostream> using namespace std; int main() { int p, e, i, d; int n = 0; int j = 1; while( 1 ) { cin >> p >> e >> i >> d; if( p == -1 && e == -1 && i == -1 && d == -1 ) break; n = ( p * 5544 + e * 14421 + i * 1288 - d + 21252 ) % 21252 ; if(!n) n = 21252; cout << "Case " << j++ << ": the next triple peak occurs in " << n << " days." << endl; } return 0; } 就一个地方不一样,我测试了下几个重要的数据,都一样的。。不知道我的为什么WA Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator