#include <iostream>
#include <vector> // Dinamik matrisler için vektör kullanılacak
using namespace std;
int main() {
int row, column, input;
cout << "Generated Matrix;\n--> row: ";
cin >> row;
cout << "--> column: ";
cin >> column;
// Matrislerin tanımlanması
vector<vector<int>> matrix1(row, vector<int>(column));
vector<vector<int>> matrix2(row, vector<int>(column));
vector<vector<int>> result(row, vector<int>(column));
cout << "\n1. MATRIX\n";
for (int i = 0; i < row; i++) {
for (int j = 0; j < column; j++) {
cout << i + 1 << ". row " << j + 1 << ". column: ";
cin >> input;
matrix1[i][j] = input;
}
}
cout << "1. matrix Completed.\n\n";
cout << "2. MATRIX\n";
for (int i = 0; i < row; i++) {
for (int j = 0; j < column; j++) {
cout << i + 1 << ". row " << j + 1 << ". column: ";
cin >> input;
matrix2[i][j] = input;
}
}
cout << "2. matrix Completed.\n\n";
// İki matrisin toplamı
for (int k = 0; k < row; k++) {
for (int t = 0; t < column; t++) {
result[k][t] = matrix1[k][t] + matrix2[k][t];
}
}
// Toplamı ekrana yazdırma
cout << "result;\n\n";
for (int a = 0; a < row; a++) {
for (int b = 0; b < column; b++) {
cout << "\t" << result[a][b];
}
cout << endl;
}
return 0;
}