Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.85 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <conio.h>
  4. using namespace std;
  5.  
  6. int main ()
  7. {
  8.     int N = 3;
  9.     double a[N][2 * N], b[N];
  10.     int i, j, k;
  11.     double x;
  12.    
  13.     cout << "x = ";
  14.     cin >> x;
  15.    
  16.     for (i = 0; i < N; ++i)
  17.     {
  18.         for (j = 0; j < 2 * N; ++j)
  19.         {
  20.             a[i][j] = rand() % 10;
  21.             cout << a[i][j] << " ";
  22.             }
  23.         cout << endl;
  24.         }
  25.     cout << "\n";
  26.    
  27.     for (k = 0; k < N; ++k)
  28.     {
  29.         for (i = 0; i < N; ++i)
  30.         {
  31.             b[k] = 1;
  32.            
  33.             for (j = 0; j < 2 * N; ++j)
  34.             {
  35.                 a[i][j] = rand() % 10;
  36.                
  37.                 if (a[i][j] > x)
  38.                 b[k] = 0;
  39.                  }
  40.             }
  41.         cout << b[k] << " ";
  42.         }
  43.    
  44.     getch ();
  45.     return 0;
  46.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement