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

新手求救!! 哪错了啊。。。

Posted by xuelang at 2008-03-22 13:41:17 on Problem 1663
#include <iostream>
using namespace std;
int main()
{
	int N;
	cin>>N;
	for( int m = 0; m < N; m++ )
	{
		int x, y;
		cin>>x>>y;
		if( x>=0 && x<5001 && y>=0 && y<5001 )
		{
			if( x==y || x-y == 2)
			{
				if( x%2 == 0 )
				{
					cout<<x+y<<endl;
				}
				else
				{
					cout<<x+y-1<<endl;
				}
			}
			else
			{
				cout<<"No Number"<<endl;
			}
		}

	}
	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