Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include < conio.h>
- #include <iostream>
- using namespace std;
- int main()
- {
- int i, j, N = 3, M = 3, a[3][3], b[3][3]; int c[3][3]; // N - число столбцев. М - число рядков.
- char quit;
- do
- {
- cout << "\nInput matrix A \n";
- for (i = 0; i < N; i++)
- {
- for (j = 0; j < M; j++)
- cin >> a[i][j];
- }
- cout << "Input matrix B " << endl;
- for (i = 0; i < N; i++)
- {
- for (j = 0; j < M; j++)
- cin >> b[i][j];
- }
- for (i = 0; i < N; i++)
- {
- for (j = 0; j < M; j++)
- c[i][j] = a[i][j] + b[i][j];
- }
- system("cls");
- cout << " \t Summation Matrix \n";
- for (i = 0; i < N; i++)
- {
- for (j = 0; j < M; j++)
- cout << "\t" << c[i][j] << "\t";
- cout << endl;
- }
- cout << "\n\t To continue press y - " ;
- } while (cin >> quit && quit == 'y');
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement