MarcinKrol

Zad 1 - Operacje na plikach

Jun 12th, 2020
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include <iostream>
  2. #include <time.h>
  3. #include <cstdlib>
  4. #include<fstream>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10. ofstream zapis_plik ("Plik.txt");
  11.  
  12. if (!zapis_plik.is_open())
  13. {
  14. cout << "brak dostepu do pliku" ;
  15. }
  16. srand(time(NULL));
  17.  
  18. for(int i=1; i<=10; i++)
  19. {
  20. zapis_plik << 1+rand()%(30-1+1) << endl;
  21. }
  22.  
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment