A+B

作者: 李耳_9992 | 来源:发表于2018-12-09 20:42 被阅读0次

Calculate A + B.
Input
Each line will contain two integers A and B. Process to end of file.
Output
For each case, output A + B in one line.
Sample Input
1 1
Sample Output
2

多个数据输入,求和
换行输出

#include<stdio.h>
int main()
{
    int A, B,C;
    while (~scanf("%d%d", &A, &B))
    {
        C = A + B;
        printf("%d\n", C);
    }
}

相关文章

网友评论

      本文标题:A+B

      本文链接:https://www.haomeiwen.com/subject/snwkhqtx.html