poj 1663 Number Steps

poj 1663 Number Steps,第1张

poj 1663 Number Steps
#include <iostream>#include <cstdlib>#include <cstdio>#include <cstring>using namespace std;int main(){    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("%dn", x + y);        else printf("%dn", x + y - 1);    }    return 0;}

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/4896637.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-12
下一篇 2022-11-12

发表评论

登录后才能评论

评论列表(0条)

保存