题解 | #Number Steps#

Number Steps

https://www.nowcoder.com/practice/e3d8d4dd9ec740f9b1e7fc1e8574ba21

#include<cstdio>
int main() {
   
    int x, y;
    
        scanf("%d%d", &x, &y);
        if ((x + y) % 2 == 0 && ((x - y) == 2 || (x - y) == 0)) {
            if (y % 2 == 1) {
                printf("%d\n", x + y - 1);
            } else {
                printf("%d\n", x + y);
            }
        } else {
            printf("No Number\n");
        }
    }

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务