有关ACM算法的一道题,请各位大牛帮帮忙!Problem - A+B for Input-Output DescriptionYour task is to calculate the sum of some integers.InputInput contains multiple test cases, and one case one line. Each case starts with an integer N, and

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/28 17:49:09
有关ACM算法的一道题,请各位大牛帮帮忙!Problem - A+B for Input-Output DescriptionYour task is to calculate the sum of some integers.InputInput contains multiple test cases, and one case one line. Each case starts with an integer N, and

有关ACM算法的一道题,请各位大牛帮帮忙!Problem - A+B for Input-Output DescriptionYour task is to calculate the sum of some integers.InputInput contains multiple test cases, and one case one line. Each case starts with an integer N, and
有关ACM算法的一道题,请各位大牛帮帮忙!
Problem - A+B for Input-Output
DescriptionYour task is to calculate the sum of some integers.InputInput contains multiple test cases, and one case one line. Each case starts with an integer N, and then N integers follow in the same line.
OutputFor each test case you should output the sum of N integers in one line, and with one line of output for each line in input.
Sample Input4 1 2 3 4
5 1 2 3 4 5Sample Output10
15
这是题目,我的代码是:
#include
#include
int main()
{
int i,a,b,sum;
scanf("%d",&a);
sum=0;
for(i=0;i

有关ACM算法的一道题,请各位大牛帮帮忙!Problem - A+B for Input-Output DescriptionYour task is to calculate the sum of some integers.InputInput contains multiple test cases, and one case one line. Each case starts with an integer N, and
这道题属于多组数据输入的,而你的程序只能接受一组数据.
改成这样试试:
#include
#include
int main()
{
int i,a,b,sum;
while(scanf("%d",&a) != EOF){
sum=0;
for(i=0;i

有关ACM算法的一道题,请各位大牛帮帮忙!Problem - A+B for Input-Output DescriptionYour task is to calculate the sum of some integers.InputInput contains multiple test cases, and one case one line. Each case starts with an integer N, and 2x+0.2x×2=36这是一道解方程的题,请各位大哥哥大姐姐帮帮忙! 一道高中地理题就是第二大题(读图阴影部分为黑夜……)那道,我用红笔订正的空格请各位老师帮帮忙 35×68+68+68×64的竖式简便算法请各位大哥帮帮忙吧! 提供几道Dijkstra算法的ACM水题练习 acm程序设计的都有什么算法 ACM的一道题,但是数字大了,过不了!.2的64次方应该用什么类型保存! 请问中国现在GPD在世界上排第几请各位好心的大哥哥、大姐姐帮帮忙 一道物理大题,有关机械运动的, 我要5,请各位大哥哥大姐姐帮帮忙 一道简单的微积分题目函数y=x^2在[-1,1]上曲线的长度?请注明过程我是一位初中生,自学微积分,遇到一点小麻烦,请各位大哥哥大姐姐帮帮忙,写明过程。 有关ACM算法的一道题,又到学期末,小明迎来了又一次的期末考试.虽然每学期都要考试,但是这次期末考试对小明来说意义重大.因为小明爱慕已久的女神说,如果小明这次考了全班前三名就做他 小弟急需有关描写“思愁”的诗句要有诗的作者,题目,诗句请各位帮帮忙 有关团结合作的俗语请各位大姐大哥帮帮忙,答好了给高价积分! 语文论据查找有关习惯的论据请各位帮帮忙,我会追加分! 一道acm的排序题Snow_storm有n(0 蝗虫大发生的原因要交论文的啊,请各位“百度”的朋友帮帮忙, 按顺序把韵母表的韵母排列下来?请各位大爷们帮帮忙吧