A+B for Input-Output Practice 这是ACM杭大题库的一道题各位大哥大姐们谁知道答案啊?
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/07/16 12:02:06
A+B for Input-Output Practice 这是ACM杭大题库的一道题各位大哥大姐们谁知道答案啊?
Problem Description
Your task is to Calculate a + b.
Input
Input contains an integer N in the first line,and then N lines follow.Each line consists of a pair of integers a and b,separated by a space,one pair of integers per line.
Output
For 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 Input
2
1 5
10 20
Sample Output
6
30
Problem Description
Your task is to Calculate a + b.
Input
Input contains an integer N in the first line,and then N lines follow.Each line consists of a pair of integers a and b,separated by a space,one pair of integers per line.
Output
For 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 Input
2
1 5
10 20
Sample Output
6
30
题目的翻译是:
题目 计算a+b
输入:首先输入一个N代表下面的行数,然后在下面每行中输入两个数ai和bi,用空格分开.
输出:输出N行,每行输出ai+bi的和.
算法(不知道你会什么语言,所以只拿自然语言描述了):
Step1.获取N,进行标准化判断(即若N不是正整数,则提示错误);
Step2.建立数组A[N];
Step3.For i=1 to N do
{
读入a,b;(更细致一些的话可以加入空格判断,即判断a后第一个不是空格的字符)
将a+b写入A[i];
}
Step4.For i=1 to N do
{
输出A[i];
输出回车键;
}
再问: 您能把程序给写出来吗?我自己调。
再答: int N; float a,b; cin>>N; int A[N]; for (i=1;i>a>>b; A[i]=a+b;} for (i=1;i
题目 计算a+b
输入:首先输入一个N代表下面的行数,然后在下面每行中输入两个数ai和bi,用空格分开.
输出:输出N行,每行输出ai+bi的和.
算法(不知道你会什么语言,所以只拿自然语言描述了):
Step1.获取N,进行标准化判断(即若N不是正整数,则提示错误);
Step2.建立数组A[N];
Step3.For i=1 to N do
{
读入a,b;(更细致一些的话可以加入空格判断,即判断a后第一个不是空格的字符)
将a+b写入A[i];
}
Step4.For i=1 to N do
{
输出A[i];
输出回车键;
}
再问: 您能把程序给写出来吗?我自己调。
再答: int N; float a,b; cin>>N; int A[N]; for (i=1;i>a>>b; A[i]=a+b;} for (i=1;i
A+B for Input-Output Practice 这是ACM杭大题库的一道题各位大哥大姐们谁知道答案啊?
杭电的acm的题A+B for Input-Output Practice (IV)
一道ACM的入门题:A+B for Input-Output Practice1(入门)DescriptionYour
c程序acm题目A+B for Input-Output Practice (VII) Time Limit : 200
一道C语言题:A+B for Input-Output Practice (III)
A+B for Input-Output Practice (VIII) 为什么 我在 杭电 上 做是 Presenta
what___lovely weather it is?A / B the C an D a 此题答案是A请各位大哥大姐
假如:A+B=明 3A=晶 那么:15A=( ) 20A+B=( ) 这是一道语文题啊!大哥大姐帮帮忙!
《鼾声》的阅读答案啊,各位大哥大姐拜托啊!
七年级下册英语句型转换200题附答案 各位大哥大姐们啊
有道题答案有些看不懂,希望各位大哥大姐们帮帮忙啊.崇拜你们.
各位大哥大姐们