题解 | 多组数据a+b III

多组数据a+b III

https://www.nowcoder.com/practice/7e094c0a3a9945b3bee8e1f3c9ea246a

#include <stdio.h>
#if 0
int main() {
    int a, b;
    while (scanf("%d %d", &a, &b) != EOF) { // 注意 while 处理多个 case
        // 64 位输出请用 printf("%lld") to 
        printf("%d\n", a + b);
    }
    return 0;
}
#endif
int main() {
    int a,b;
    while(scanf("%d %d", &a, &b)!=EOF) {
        if ((a ==0) && (b == 0)) {
           break;
        }

        printf("%d\n", a+b);

    }

    return 0;
}

全部评论

相关推荐

点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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