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,b=30,c;
- int main()
- {
- srand(time(NULL));
- ofstream zapis_do_pliku ("liczby.txt");
- for(int i=1; i<=10; i++)
- {
- c=a+rand()%(b-a+1);
- cout << c << " ";
- zapis_do_pliku<<c<<" ";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment