RafalSobala

zad2/rand

Apr 6th, 2020
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4. int a=30,b=40;
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     cout << "Liczby: ";
  10.     srand(time(NULL));
  11.     cout << a+rand()%(b-a+1);
  12.     cout << " " <<a+rand()%(b-a+1);
  13.     cout << " " <<a+rand()%(b-a+1);
  14.     cout << " " <<a+rand()%(b-a+1);
  15.     cout << " " <<a+rand()%(b-a+1);
  16.     return 0;
  17. }
Add Comment
Please, Sign In to add comment