MichalWalczak

Zad 1 PSEUDORANDOM

Apr 18th, 2020
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. #include <iostream>
  2. #include <time.h>
  3. #include <cstdlib>
  4.  
  5. using namespace std;
  6.  
  7. int losowe(){
  8. int x;
  9. srand(time(NULL));
  10. for(int i=1; i<=3; i++){
  11.     x=rand()%10+1;
  12.     cout<<x<<endl;
  13. }
  14.  
  15.  
  16.  
  17. }
  18.  
  19.  
  20. int main()
  21. {
  22.     losowe();
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment