Advertisement
MeehoweCK

Untitled

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