Advertisement
MeehoweCK

Untitled

May 20th, 2023
654
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. // struktura - składnia:
  6. struct Student     // Student od tego momentu jest nazwą naszego własnego typu zmiennej
  7. {
  8.     string imie;
  9.     string nazwisko;
  10.     int wiek;
  11.     string e_mail;
  12.     double srednia_ocen;
  13. };
  14.  
  15. int main()
  16. {
  17.     Student student1;       // utworzenie obiektu typu Student o nazwie student1
  18.     student1.imie = "Piotr";
  19.     student1.nazwisko = "Kowalski";
  20.     student1.wiek = 22;
  21.     student1.e_mail = "piotr.kowalski@gmail.com";
  22.     student1.srednia_ocen = 3.8;
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement