Advertisement
diiankka

Lab7n2

Dec 9th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int const n = 11;
  8.     int k = 6;
  9.     double mas[n][n];
  10.     for (int i = 0; i < n; i++)
  11.         for (int j = 0; j < n; j++)
  12.             //cin >> mas[i][j];
  13.             mas[i][j] = rand() % 1000 / 100.0;
  14.     cout << "mas:" << endl;
  15.     for (int i = 0; i < n; i++) {
  16.         for (int j = 0; j < n; j++) {
  17.             cout << mas[i][j] << "\t";
  18.         }
  19.         cout << endl;
  20.     }
  21.     {
  22.         for (int i = 0; i < 5; i++)
  23.         {
  24.             for (int j = k; j < 11; j++){
  25.                 mas[i][j] = 1;
  26.                 }
  27.        
  28.         k++;
  29.         }
  30.     }
  31.     cout << "New mas" << endl;
  32.     for (int i = 0; i < n; i++) {
  33.         for (int j = 0; j < n; j++) {
  34.             cout << mas[i][j] << "\t";
  35.         }
  36.         cout << endl;
  37.     }
  38.     return 0;
  39.     system("pause");
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement