Advertisement
themlgyo

Untitled

Oct 19th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3.  
  4. using namespace std;
  5. void print_mass(double x[5][5])
  6. {
  7.     int i, j;
  8.     for (i = 0; i < 5; i++)
  9.     {
  10.         for (j = 0; j < 5; j++)
  11.         {
  12.             cout << setw(10) << x[i][j];
  13.         }
  14.         cout << endl;
  15.     }
  16. }
  17. int main()
  18. {
  19.     double A[5][5], B[5][5];
  20.     int i, j;
  21.     for (i = 0; i < 5; i++)
  22.     {
  23.         for (j = 00; j < 5; j++)
  24.         {
  25.             A[i][j] = 2.3*i + j;
  26.             B[i][j] = i - 1.5*j;
  27.         }
  28.     }
  29.     cout << "massiv A: " << endl;
  30.     print_mass(A);
  31.     cout << "massiv B: " << endl;
  32.     print_mass(B);
  33.     return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement