poj1663

简单题

View Code
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
using namespace std;

int main()
{
    //freopen("t.txt", "r", stdin);
    int t;
    scanf("%d", &t);
    while (t--)
    {
        int x, y;
        scanf("%d%d", &x, &y);
        if (!((x == y) || (x - y == 2)))
        {
            puts("No Number");
            continue;
        }
        if ((x == y) ^ ((x + y) % 4 != 0))
            printf("%d\n", x + y);
        else
            printf("%d\n", x + y - 1);
    }
    return 0;
}

 

posted @ 2013-03-15 13:27  undefined2024  阅读(137)  评论(0)    收藏  举报