题目:
给(x,y),输出数字
Sample Input
3
4 2
6 6
3 4
Sample Output
6
12
No Number
代码:
#include<stdio.h>
#include<string.h>
using namespace std;
int main(){
int x,y,t;
scanf("%d",&t);
while(t--){
scanf("%d%d",&x,&y);
if(x==y){
if(x%2==0) printf("%d\n",x*2);
else printf("%d\n",x*2-1);
}
else if((x-y)==2){
if(x%2==0) printf("%d\n",(x-1)*2);
else printf("%d\n",y*2+1);
}
else printf("No Number\n");
}
return 0;
}