4 条题解

  • 3
    @ 2022-10-25 17:55:53
    #include <iostream>
    #include <stack>
    #include <cmath>
    #include <vector>
    #include <string.h>
    #include <queue>
    #include <stdio.h>
    #include <iomanip>
    #include <cstdio>
    #include <algorithm>
    #define int long long
    using namespace std;
    const int N = 1e5 + 10;
    const int INF = 0x3f3f3f3f;
    signed main()
    {
    	int T;
    	cin >> T;
    	int ans = 0, a, n = 0;
    	while(T--)
    	{
    		ans = 0;
    		cin >> n;
    		for(int i = 1; i <= n; i++)
    		{
    			cin >> a;
    			ans += a;
    		}
    		cout << ans << endl;
    	}
    	return 0;
    }
    
    • 1
      @ 2023-4-2 17:22:51

      #include<bits/stdc++.h> using namespace std; int main() { int n,m,a,s=0; cin>>n; for(int i=1; i<=n; i++) { cin>>m; for(int j=1; j<=m; j++) { cin>>a; s+=a; } cout<<s<<endl; s=0; } return 0; }

      • 1
        @ 2022-3-27 19:44:59

        #include<iostream>

        using namespace std;

        int main() {

        int n,a,b,sum=0;

        cin>>n;

        for(int i=1;i<=n;i++){

        cin>>a;
        
        for(int j=1;j<=a;j++){
        
        cin>>b;
        
        sum+=b;	
        
        }
        

        cout<<sum<<endl<<" "<<endl;

        sum=0;

        }

        }

        • 0
          @ 2024-3-10 21:03:46
          #include <iostream>
          #include <stack>
          #include <cmath>
          #include <vector>
          #include <string.h>
          #include <queue>
          #include <stdio.h>
          #include <iomanip>
          #include <cstdio>
          #include <algorithm>
          #define int long long
          using namespace std;
          const int N = 1e5 + 10;
          const int INF = 0x3f3f3f3f;
          signed main()
          {
          	int T;
          	cin >> T;
          	int ans = 0, a, n = 0;
          	while(T--)
          	{
          		ans = 0;
          		cin >> n;
          		for(int i = 1; i <= n; i++)
          		{
          			cin >> a;
          			ans += a;
          		}
          		cout << ans << endl;
          	}
          	return 0;
          }
          
          • 1

          信息

          ID
          990
          时间
          1000ms
          内存
          32MiB
          难度
          2
          标签
          递交数
          281
          已通过
          166
          上传者