Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <cstdlib>
- #include <ctime>
- using namespace std;
- int tab[10];
- int main()
- {
- ofstream zapis_do_pliku ("dane.txt");
- if (!zapis_do_pliku.is_open())
- {
- cout<<"Brak dostêpu do pliku" ;
- }
- srand(time(NULL));
- for(int i=1; i<=10; i++)
- {
- tab[i] = tab[i]+ rand()%30;
- zapis_do_pliku << tab[i]<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement