| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:此题真的很水,发现规律很容易ac,不用开数组,也不用循环。。哈哈In Reply To:此题真的很水,发现规律很容易ac,不用开数组,也不用循环。。哈哈 Posted by:cschenlu at 2009-08-27 20:08:47 #include<iostream>
using namespace std;
int main()
{
int n;
scanf("%d",&n);
while(n--){
int x,y;
scanf("%d%d",&x,&y);
if(y>x||(x==1&&y==0)||x-y==1||x-y>2) printf("No Number\n");
else {
if(x%2==0) printf("%d\n",x+y);
else printf("%d\n",x+y-1);
}
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator