首页 > 代码库 > 1096 A+B for Input-Output Practice (VIII)

1096 A+B for Input-Output Practice (VIII)

#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)