Advertisement
Dawid_PAr

Untitled

Aug 23rd, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <fstream>
  4. #include <sstream>
  5.  
  6. using namespace std;
  7.  
  8. struct Pracownik
  9. {
  10. int wiek;
  11. string imie;
  12. };
  13.  
  14. struct Kierowca
  15. {
  16. string prawoJ;
  17. string car;
  18. Pracownik man;
  19. };
  20.  
  21. struct Sprzedawca
  22. {
  23. int hDeal;
  24. string motto;
  25. Pracownik man1;
  26. };
  27.  
  28. Sprzedawca dodajS()
  29. {
  30. fstream zapisz;
  31. string temp;
  32. Sprzedawca s;
  33. zapisz.open("sprzedawca.txt", fstream::in | fstream::out | fstream::app);
  34. cout << "IMIE: ";
  35. cin >> s.man1.imie;
  36. zapisz << s.man1.imie << endl;
  37. cout << "WIEK: ";
  38. cin >> s.man1.wiek;
  39. zapisz << s.man1.wiek << endl;
  40. cout << "NAJWIEKSZY KONTRAKT: ";
  41. cin >> s.hDeal;
  42. zapisz << s.hDeal << endl;
  43. cout << "MOTTO: ";
  44. getline(cin, s.motto); // POMIJA TEN FRAGMENT
  45. zapisz << s.motto << endl;
  46. zapisz.seekp(0);
  47. zapisz.clear();
  48. zapisz.close();
  49. return s;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement