小玖


私信TA

用户名:huang214

访问量:857

签 名:

撒狗粮的真恶心

等  级
排  名 2663
经  验 2138
参赛次数 0
文章发表 14
年  龄 0
在职情况 学生
学  校 贺州学院
专  业 通信工程

  自我简介:

解题思路:定义三个变量来保存数据

注意事项:

参考代码:

#include<bits/stdc++.h>//c++万能头文件

using namespace std;

int main(){

int n;

int a,b;

int sum;

cin>>n;

while(n--){

cin>>a;

sum=0;//每次新的开始清零

while(a--){

cin>>b;

sum+=b;

}

cout<<sum<<endl;

}

return 0;

}


 

0.0分

0 人评分

  评论区