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 lzxzy at 2018-08-28 09:16:19 on Problem 1663
#include <cstdio>
using namespace std;
int n,x,y;

int main()
{
	scanf("%d",&n);
	while(n--)
	{
		scanf("%d%d",&x,&y);
		if(x==y)printf("%d\n",(x%2==0)?x*2:(x-1)*2+1);
		else if(x-2==y)printf("%d\n",(x%2==0)?(x-1)*2:(x-1)*2-1);
		else printf("No Number\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