标签:sum names output using space nbsp namespace i++ cout
#include<iostream>
using namespace std;
int main(){
int ts;
cin>>ts;
for(int i=0;i<ts-1;i++){
int n,a,b;
while(cin>>n){
int sum = 0;
while(n--){
int t;
cin>>t;
sum+=t;
}
cout<<sum<<endl<<endl;
}
}
int n,a,b;
cin>>n;
int sum = 0;
while(n--){
int t;
cin>>t;
sum+=t;
}
cout<<sum<<endl;
return 0;
}
1096 A+B for Input-Output Practice (VIII)
标签:sum names output using space nbsp namespace i++ cout
原文地址:http://www.cnblogs.com/sysu-eeman-yang/p/5987449.html