Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <ctime>
- #include <cstdlib>
- #include <fstream>
- using namespace std;
- int a=1;
- int b=30;
- int c;
- int main(){
- srand(time(NULL));
- ofstream losowe_liczby ("losowe_liczby.txt");
- for(int i=1; i<=10; i++){
- c=a+rand()%(b-a+1);
- cout << c << " ";
- losowe_liczby << c << " ";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement