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 13698975 at 2009-08-12 15:37:07 on Problem 1006
#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:
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