Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

一直WA..求测试数据把我的程序干掉或其他解释

Posted by bigeyex at 2010-03-12 16:53:13 on Problem 1006
已经把题目中的数据和论坛里的测试数据都试过了,还是WA,只好希望高手给予解释了……

#include<iostream>
using namespace std;


int main(){
    int a1,a2,a3,d,i,days;
    i=1;
    while(1)
    {
        cin >> a1 >> a2 >> a3 >> d;
        if(a1 == -1)break;
        do{
            if(a1 <= a2 && a1 <= a3)a1 += 23;
            else if(a2 <= a1 && a2 <= a3)a2 += 28;
            else a3 += 33;
        }while(a1 != a2 || a2 != a3);
        days = a1 - d;
        if(days > 21252) days=days-21252;
        cout << "Case " << i << ": the next triple peak occurs in " << days << " days." << endl;
       i++; 
    }
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator