Advertisement
MeehoweCK

Untitled

Nov 18th, 2020
482
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4.  
  5. using namespace std;
  6.  
  7. const int N = 6;
  8.  
  9. void wypisz(int tablica[][N])
  10. {
  11.     for(int i = 0; i < N; ++i)
  12.     {
  13.         for(int j = 0; j < N; ++j)
  14.             cout << tablica[i][j] << '\t';
  15.         cout << endl;
  16.     }
  17.     cout << endl;
  18. }
  19.  
  20. int main()
  21. {
  22.     int tablica[N][N];
  23.     srand(time(nullptr));
  24.     for(int i = 0; i < N; ++i)
  25.         for(int j = 0; j < N; ++j)
  26.             tablica[i][j] = rand() % 10;
  27.     wypisz(tablica);
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement