Advertisement
Guest User

Untitled

a guest
Apr 26th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. #include <cstdlib>
  2. #include <iostream>
  3. #include <math.h>
  4. using namespace std;
  5. struct student
  6. {
  7.   string imie,nazwisko,kierunek;
  8.   int rok;
  9. };
  10.  
  11. student czytaj(void);
  12.  
  13. int main(int argc, char *argv[])
  14. {
  15.  student st;
  16.  st=czytaj();
  17.  cout <<"Imie:" << st.imie << endl;
  18.  cout <<"Nazwisko:" << st.nazwisko << endl;
  19.  cout <<"Kierunek:" << st.kierunek << endl;
  20.  cout <<"Rok:" << st.rok << endl;
  21.  system("PAUSE");
  22.  return EXIT_SUCCESS;
  23. }
  24.  
  25.  
  26. student czytaj(void)
  27. {
  28. student st;
  29. cout << "Podaj imie" << endl;
  30. cin >> st.imie;
  31. cout << "Podaj nazwisko" << endl;
  32. cin >> st.nazwisko;
  33. cout << "Podaj kierunek studiow" << endl;
  34. cin >> st.kierunek;
  35. cout << "Podaj rok studiow" << endl;
  36. cin >>  st.rok;
  37. return st;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement