MeehoweCK

Untitled

Aug 5th, 2021
670
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4.  
  5. using namespace std;
  6.  
  7. const short N = 5;
  8.  
  9. void wypelnij_tablice(short tab[][N])
  10. {
  11.     for(short i = 0; i < N; ++i)
  12.         for(short j = 0; j < N; ++j)
  13.             tab[i][j] = rand() % 100;
  14. }
  15.  
  16. void wypisz_tablice(short tab[][N])
  17. {
  18.     for(short i = 0; i < N; ++i)
  19.     {
  20.         for(short j = 0; j < N; ++j)
  21.             cout << tab[i][j] << '\t';
  22.         cout << endl;
  23.     }
  24. }
  25.  
  26. int main()
  27. {
  28.     short tablica[N][N];
  29.     wypelnij_tablice(tablica);
  30.     wypisz_tablice(tablica);
  31.     return 0;
  32. }
RAW Paste Data