Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int macierz[50][50], m, n, a;
  8.  
  9.     cout << "Number of raws: ";
  10.     cin >> m;
  11.  
  12.     cout << "Number of columns: ";
  13.     cin >> n;
  14.  
  15.     cout << "MAX number: ";
  16.     cin >> a;
  17.     cout << endl;
  18.  
  19.  
  20.     for (int i = 0; i < m; i++)
  21.     {
  22.         for (int j = 0; j < n; j++)
  23.         {
  24.             macierz[i][j] = 1 + rand() % a;
  25.             cout << macierz[i][j] << " ";
  26.         }
  27.         cout << endl;
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement