文章

6

粉丝

41

获赞

0

访问

1.3k

头像
翻转数的和 题解:
P1003 兰州大学机试题
发布于2024年3月20日 16:52
阅读数 206

#include <stdio.h>
#include <stdlib.h>

int fun(int n) {
    int res = 0;
    while (n) {
        res = res * 10 + n % 10;
        n = n / 10;
    }
    return res;
}

int main() {
    int a, b;
    while (scanf("%d %d", &a, &b) != EOF) {
        printf("%d\n", fun(a) + fun(b));
    }
    return 0;
}
 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发