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

结果都对了,就是说是wrong answer,是不是我超时还是说是其他的错误啊,救命啊!

Posted by zhyuan16 at 2005-05-09 16:16:21 on Problem 1006
//C++语言编写,只会C的哥们应该看得懂,与C不同的就是里面的输入输出不同,哥哥们救哈我啊
#include < iostream >
using namespace std;

void compute ()
{
	const int physical = 23; 
    const int emotional = 28;
    const int intellectual = 33;
	int p,e,i,d;
	int num = 1;
	while ( (p = e = i = d) != -1 )
	{
		cin>>p>>e>>i>>d;
	    if ( (p == -1)&&(e == -1)&&(i == -1)&&(d == -1) )
		{ 
			break;
		}
	    int x;
	    for ( x = 1;;x++)
		{
		    if ( ((x-p)%physical == 0) && ((x-e)%emotional == 0) && ((x-i)%intellectual == 0 ) )
			break;
		}
        cout<<"Case "<<num<<" : the next triple peak occurs in "<< x - d <<" days.";
    	num ++;
	}
}

int  main ()
{
	compute ();
	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