Guest User

Untitled

a guest
Jan 10th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int M[2][2], i = 0, j;
  8. while (i < 2)
  9. {
  10. j = 0;
  11. while (j < 2)
  12. {
  13. cout << "M[" << i << "][" << j << "]= ";
  14. cin >> M[i][j];
  15.  
  16. j++;
  17. }
  18.  
  19. cout << endl;
  20. i++;
  21. }
  22.  
  23. i = 0;
  24.  
  25. do
  26. {
  27. j = 0;
  28.  
  29. if (i == 1)
  30. {
  31. cout << "M=|";
  32. }
  33. else
  34. {
  35. cout << " |";
  36. }
  37.  
  38. while (j < 2)
  39. {
  40. cout << setw(3) << M[i][j] << setw(3);
  41. j++;
  42. }
  43. cout << "|" << endl;
  44. i++;
  45. }
  46. while (i < 2);
  47. cout << "\n\n" << endl;
  48.  
  49. return 0;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment