早教吧作业答案频道 -->其他-->
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
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!
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这道题求解。谁能帮助...的网友还看了以下:
a(a+b)(a-b)+b(b+a)(b-a)各项的公因式是4x的m+1次方-6x的m次方-2x的 2020-04-08 …
A为M*N矩阵,2、设A为m×n矩阵,下列命题中正确的是()a.若A中有n阶子式不为0,则Ax=0 2020-05-14 …
因式分解作业速答(a+b)²-(a-b)²(m+1)²-9(m-1)²(m+2n)²-(m-n)² 2020-05-22 …
1、如果不等式(1-a)x>2(1-a)的解集是x<2,那么a的取值范围是,若解集是x>2,则a的 2020-06-03 …
有难度M{A,B,C}==(A+B+C)/3m{A,B,C}=A(A为三数中最小的一个)则若M{A 2020-06-13 …
线性代数问题线性方程组Ax=b,其中A为m×n阶矩阵,则()(A)当R(A)=m时,必有解(B)m 2020-07-31 …
因式分解急!1.a(m+n)-b(m+n)⒉xy(a-b)+x(a-b)3.n(x+y)+x+y⒋a 2020-11-03 …
初三下册数学锐角三角函数的一道题,求详解已知a为锐角,m=sina+cosa,则m的取值范围.其实这 2020-12-08 …
关于X的方程a(x+m)^2+b=0的解是x1=-2,x2=1(a,m,b均为常数,a不等于0),则 2020-12-23 …
方程(a-2)x平方-(2a-1)x+a=0有实根则a的取值范围?2.分式方程(x-2)分之m+(x 2020-12-31 …