A + B Problem
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 499575 Accepted Submission(s): 158358
Problem Description
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
简单A+B
#include<cstdio>
int main()
{
int a,b;
while(scanf("%d%d",&a,&b)!=EOF)
{
printf("%d\n",a+b);
}
return 0;
}
本文介绍了一个经典的编程问题“A+B”,并提供了一段简洁的C语言代码实现。该问题要求读取每行两个整数A和B,直到文件结束,并输出它们的和。此题旨在帮助初学者理解基本输入输出操作及循环控制结构。
509

被折叠的 条评论
为什么被折叠?



