Advertisement
Guest User

Untitled

a guest
Feb 25th, 2020
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <cstdio>
  4. #include <string>
  5.  
  6. using namespace std;
  7. void Tworzenieplikow(int n)
  8. {
  9. fstream plik;
  10. for (int i = 0; i < n; i++)
  11. {
  12. string nazwa = "osoba";
  13.  
  14.  
  15. nazwa += to_string (i);
  16. nazwa += ".txt";
  17. plik.open(nazwa, ios::out || ios::app);
  18.  
  19. plik.close();
  20. }
  21.  
  22.  
  23.  
  24. }
  25. int main()
  26. {
  27.  
  28. string linia;
  29. fstream plik;
  30.  
  31. plik.open("plik.docx", ios::out || ios::app);
  32. if (plik.good() == true)
  33. {
  34.  
  35.  
  36. plik << endl << "witaj w pliku" << endl;
  37. plik.close();
  38.  
  39.  
  40.  
  41.  
  42.  
  43. }
  44.  
  45.  
  46. Tworzenieplikow(100);
  47.  
  48.  
  49. system("PAUSE");
  50. return 0;
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement