题目1136:Number Steps

来源:互联网 发布:mysql update表关联 编辑:程序博客网 时间:2024/06/03 20:25
#include <stdio.h> int main(){    int T,n,x,y;    scanf("%d",&T);    while(T--!=0){        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(y==x-2){            if(x%2==0)                printf("%d\n",y*2+2);            else                printf("%d\n",y*2+1);        }        else printf("No Number\n");    }    return 0;}         /**************************************************************    Problem: 1136    User: hitagiport    Language: C++    Result: Accepted    Time:10 ms    Memory:1020 kb****************************************************************/

0 0
原创粉丝点击