Advertisement
tei123

class

May 16th, 2016
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <cstdlib>
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. class osoba
  7. {
  8. private:
  9. string imie;
  10. string nazwisko;
  11. string pesel;
  12. public:
  13. void wprowadz();
  14. void wyswietl();
  15. };
  16.  
  17.  
  18. int main(int argc, char *argv[])
  19. {
  20. osoba os1;
  21. os1.wprowadz();
  22. os1.wyswietl();
  23. system("PAUSE");
  24. return EXIT_SUCCESS;
  25. }
  26.  
  27. void osoba::wprowadz()
  28. {
  29. cout << "Wprowadz dane" << endl;
  30. cin >> imie >> nazwisko >> pesel;
  31. }
  32. void osoba::wyswietl()
  33. {
  34. cout << "Dane:" << endl;
  35. cout << imie << " "<< nazwisko <<" "<< pesel<<endl;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement