Advertisement
Guest User

knlfkaskfnasf

a guest
Feb 26th, 2020
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.63 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. struct student // etap 1.1
  7. {
  8.     string imie;
  9.     string nazwisko;
  10.     string plec;
  11.     long nr_indeks;
  12.     string nr_pesel;
  13. };
  14.  
  15. void display_all_students(student tab[], int tab_size) {
  16.  
  17.  
  18. }    //etap 1.5
  19.  
  20. void display_student( student & s1 )
  21. {
  22.             //etap 1.2 i 1.3
  23.     cout << "podaj imie studenta" << endl;
  24.     cin >> s1.imie;
  25.     cout << "podaj nazwisko" << endl;
  26.     cin >> s1.nazwisko;
  27.     cout << "podaj plec studenta "<< endl;
  28.     cin >> s1.plec;
  29.     cout << "podaj nr indeksu studenta" << endl;
  30.     cin >> s1.nr_indeks;
  31.     cout << "podaj nr pesel studenta" << endl;
  32.     cin >> s1.nr_pesel;
  33.     cout << endl;
  34. }
  35.  
  36. int main()
  37. {
  38.     int liczba_studentow = 3;
  39.  
  40.     student s1; // typ i nazwa zmiennej s1
  41.     display_student(s1);//wywolanie funkcji
  42.     //etap.4
  43.     // student jest typem jak np: int ...
  44.     student tab[liczba_studentow]; // tablica 3 studentow
  45.  
  46.     //dane pierwszego studenta
  47.     tab[0].imie = "Jan";
  48.     tab[0].nazwisko = "Janowski";
  49.     tab[0].plec = "mezczyzna";
  50.     tab[0].nr_indeks = "321321";
  51.     tab[0].nr_pesel = "4324235432";
  52.     //dane drugiego studenta
  53.     tab[0].imie = "Mikolaj";
  54.     tab[0].nazwisko = "Swiety";
  55.     tab[0].plec = "mezczyzna";
  56.     tab[0].nr_indeks = "432421";
  57.     tab[0].nr_pesel = "234235432";
  58.     //dane trzeciego studenta
  59.     tab[0].imie = "Piotr";
  60.     tab[0].nazwisko = "Pan";
  61.     tab[0].plec = "mezczyzna";
  62.     tab[0].nr_indeks = "543521";
  63.     tab[0].nr_pesel = "5345635432";
  64.  
  65.     //wywolanie funkcji
  66.     display_all_students(liczba_studentow, int tab_size);
  67.  
  68.     return 0;
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement