题解 | 多组_二维数组_T组形式
多组_二维数组_T组形式
https://www.nowcoder.com/practice/fe1e902e076b46dd82e7d42e12617893
#include <iostream> #include <map> #include <vector> using namespace std; int main() { int t; cin >> t; while (t--) { int a, b; cin >> a>>b; long sum = 0; vector<vector<long>> arr(a, vector<long>(b)); for (int i = 0; i < a; i++) { for (int j = 0; j < b; j++) { cin >> arr[i][j]; sum += arr[i][j]; } } cout << sum << endl; } } // 64 位输出请用 printf("%lld")