Advertisement
MeehoweCK

Untitled

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