Advertisement
JakubJaneczek

Zadanie 1

May 31st, 2020
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. #include <iostream>
  2. #include <ctime>
  3. #include <cstdlib>
  4. #include <fstream>
  5.  
  6. using namespace std;
  7. int a=1;
  8. int b=30;
  9. int c;
  10.  
  11. int main(){
  12.     srand(time(NULL));
  13.     ofstream losowe_liczby ("losowe_liczby.txt");
  14.     for(int i=1; i<=10; i++){
  15.         c=a+rand()%(b-a+1);
  16.         cout << c << " ";
  17.         losowe_liczby << c << " ";
  18.     }
  19.  
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement