Răspuns 1:
#include <iostream>
using namespace std;
int main()
{
int A[100][100], i, j, n, m, S = 0;
cin >> n >> m;
for(i = 1; i <= m; i++)
for(j = 1; j <= n; j++)
cin >> A[i][j];
for(i = 2; i <= m; i++)
for(j = 1; j <= n; j++)
if(i % 2 == 0)
S = S + A[i][j];
cout << S;
return 0;
}
Răspuns 2:
#include <iostream>
using namespace std;
int main()
{
int A[100][100], V[100], i, j, n, x = 1;
cin >> n;
for(i = 1; i <= n; i++)
for(j = 1; j <= n; j++)
cin >> A[i][j];
for(i = 1; i <= n; i++){
V[x] = A[i][1];
x++;
}
for(i = 2; i <= n; i++){
V[x] = A[n][i];
x++;
}
for(i = 1; i < x; i++)
cout << V[i] << " ";
return 0;
}