Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- using namespace std;
- int main()
- {
- int M[2][2], i = 0, j;
- while (i < 2)
- {
- j = 0;
- while (j < 2)
- {
- cout << "M[" << i << "][" << j << "]= ";
- cin >> M[i][j];
- j++;
- }
- cout << endl;
- i++;
- }
- i = 0;
- do
- {
- j = 0;
- if (i == 1)
- {
- cout << "M=|";
- }
- else
- {
- cout << " |";
- }
- while (j < 2)
- {
- cout << setw(3) << M[i][j] << setw(3);
- j++;
- }
- cout << "|" << endl;
- i++;
- }
- while (i < 2);
- cout << "\n\n" << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment