早教吧 育儿知识 作业答案 考试题库 百科 知识分享

cacm这道题求解。谁能帮助一下A+BforInput-OutputPractice(I)TimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):14027AcceptedSubmission(s):6614ProblemDescriptionYourtaskistoCal

题目详情
c acm 这道题求解。谁能帮助一下
A+B for Input-Output Practice (I)Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 14027 Accepted Submission(s): 6614
Problem DescriptionYour task is to Calculate a + b.
Too easy?! Of course! I specially designed the problem for acm beginners.
You must have found that some problems have the same titles with this one, yes, all these problems were designed for the same aim.
InputThe input will consist of a series of pairs of integers a and b, separated by a space, one pair of integers per line.
OutputFor each pair of input integers a and b you should output the sum of a and b in one line, and with one line of output for each line in input.
Sample Input1 5
10 20
Sample Output6
30
▼优质解答
答案和解析
#include
void main()
{
int a,b,sum;
while(scanf("%d%d",&a,&b)!=EOF)
{
sum=0;
sum=a+b;
printf("%d\n",sum);
}
}
兄弟!
做ACM的题得注意使用EOF!
看了 cacm这道题求解。谁能帮助...的网友还看了以下: