Объяснение:
#include<iostream>
#include<vector>
using namespace std;
int main() {
long long n, m;
cin >> n >> m;
vector<vector<long long>> v(n);
for (long long i = 0; i < n; i++) {
for (long long j = 0; j < m; j++) {
long long a;
cin >> a;
v[i].push_back(a);
}
long long sum = 0;
cout << v[i][j] << " ";
if (v[i][j]>0) {
sum += v[i][j];
cout << endl;
cout << sum;
return 0;
Объяснение:
#include<iostream>
#include<vector>
using namespace std;
int main() {
long long n, m;
cin >> n >> m;
vector<vector<long long>> v(n);
for (long long i = 0; i < n; i++) {
for (long long j = 0; j < m; j++) {
long long a;
cin >> a;
v[i].push_back(a);
}
}
long long sum = 0;
for (long long i = 0; i < n; i++) {
for (long long j = 0; j < m; j++) {
cout << v[i][j] << " ";
if (v[i][j]>0) {
sum += v[i][j];
}
}
cout << endl;
}
cout << sum;
return 0;
}