Advertisement
Michal_Pilarski

zad4 spr

Oct 28th, 2020
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. class Pracownik
  6. {
  7. public:
  8.     string imie;
  9.     string nazwisko;
  10.     int wiek;
  11.     string plec;
  12.  
  13.     Pracownik()
  14.     {
  15.         imie = "Michal";
  16.         nazwisko = "Pilarski";
  17.         wiek = 19;
  18.         plec = "M";
  19.     }
  20.  
  21.     void metoda()
  22.     {
  23.         cout<<imie<<endl;
  24.         cout<<nazwisko<<endl;
  25.         cout<<wiek<<endl;
  26.         cout<<plec<<endl;
  27.     }
  28. };
  29.  
  30. int main()
  31. {
  32.     Pracownik().metoda();
  33.  
  34.  
  35.     return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement