Advertisement
KatarzynaBracha

1.klasy_c++

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