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 Daisy1 at 2008-11-19 23:18:43
In Reply To:Re:why this is wrong.HELP!! 1006 Posted by:90401504 at 2004-12-01 08:27:51
#include <iostream>
using std::cin ;
using std::cout ;

int main(){
	int a[100][4] = {0} ;
	int num = 0 ;
	int days = 0 ;
	int l = 0 ;
	for (int i = 0 ; i<100 ; i++)
	{
		for(int j=0;j<4;j++)
		{
			cin >> a[i][j] ;
			if (a[i][j] == -1)
			{
			  num++ ;
			}
		}
		if (num==4)
		{
			l = i ;
			break ;
		}
	}

	for(int m = 0 ; m<l ;m++)
	{
		if (a[m][3] >= a[m][0]&&a[m][3] >= a[m][1]&&a[m][3] >= a[m][2])
		{
			for(int k = 1; k <= 21252 ;k++)
			{
		         if ( (k-(23-(a[m][3]-a[m][0])))%23==0 && (k-(28-(a[m][3]-a[m][1])))%28==0 && (k-(33-(a[m][3]-a[m][2])))%33 == 0)
				 {
		             	days = k ;
						cout << "Case "<< m+1 << ": the next triple peak occurs in "<<days<<" days." << "\n"  ;
				 }
				 
			}
		}
	
	}

              return 0 ;



}

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