zoj1414

来源:互联网 发布:怎么优化宝贝标题贴吧 编辑:程序博客网 时间:2024/06/05 03:36

简单题

#include <iostream>using namespace std;int main(){    int num,x,y;    cin >> num;    while(num--)    {        cin >> x >> y;        if(y%2 == 0)        {            if(y == x)                cout << 2*y << endl;            else if(y == x - 2)                cout << 2*y + 2 << endl;            else                cout << "No Number" << endl;        }        else        {            if(y == x)                cout << 2*y - 1 << endl;            else if(y == x - 2)                cout << 2*y + 1 << endl;            else                cout << "No Number" << endl;        }    }    return 0;}


0 0
原创粉丝点击