A + B Problem
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 780120 Accepted Submission(s): 238611
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
#include "stdio.h"
int main()
{
int a,b;
while (scanf("%d %d",&a,&b) != EOF)
{
printf("%d\n",a+b);
}
}
本文介绍了一个简单的编程问题——A+B问题,通过示例代码展示了如何读取两个整数并计算它们的和。该问题适合编程初学者练习基本的输入输出及算术运算。
1240

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



