#include <iostream>
#include <stdio.h>
using namespace std;
class Matrix {
private:
int x;
int y;
int **arr;
public:
Matrix(int x, int y) {
this->x = x;
this->y = y;
}
void setMatrix() {
arr = new int *[x];
for (int i = 0; i < x; i++) arr[i] = new int [y];
for (int i = 0; i < this->x; i++) {
for (int j = 0; j < this->y; j++) {
cout << "arr[" << i << "][" << j << "] = ";
cin >> arr[i][j];
}
}
}
void getMatrix(int a, int b) {
for (int i = 0; i < a; i++) {
for (int j = 0; j < b; j++) {
cout << arr[i][j] << " ";
}
cout << "\n";
}
}
void getSumm(int n) {
int summ = 0;
for (int j = 0; j < y; j++) {
summ+= arr[n][j];
}
cout << summ << endl;
}
};
int main() {
setlocale(LC_ALL, "rus");
Matrix arr(3, 3);
arr.setMatrix();
arr.getMatrix(2, 2);
arr.getSumm(2);
return 0;
}