Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2020
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4.  
  5. using namespace std;
  6.  
  7. struct student
  8. {
  9. string imie;
  10. string nazwisko;
  11. string plec;
  12.  
  13. int pesel;
  14. int indeks;
  15. };
  16.  
  17. void display_student(vector <student> ktos, int ilosc)
  18. {
  19. for( int i=0; i<ilosc; i++)
  20. {
  21. cout<<"Imie: "<<ktos[i].imie<<endl;
  22. cout<<"Nazwisko: "<<ktos[i].nazwisko<<endl;
  23. cout<<"Plec: "<<ktos[i].plec<<endl;
  24. cout<<"Pesel: "<<ktos[i].pesel<<endl;
  25. cout<<"Indeks: "<<ktos[i].indeks<<endl;
  26. }
  27. }
  28.  
  29. void add_student( vector <student> &uczen, int ilosc )
  30. {
  31. for(int i=0; i<ilosc; i++)
  32. {
  33. uczen.push_back(student());
  34. cout<<"Imie: ";
  35. getline( cin, uczen[i].imie );
  36. cout<<"Nazwisko: ";
  37. getline( cin, uczen[i].nazwisko );
  38. cout<<"Plec: ";
  39. getline( cin, uczen[i].plec );
  40. cout<<"Pesel: ";
  41. cin>>uczen[i].pesel;
  42. cin.ignore();
  43. cout<<"Indeks: ";
  44. cin>>uczen[i].indeks;
  45. cin.ignore();
  46.  
  47. }
  48. }
  49.  
  50. int znajdz( vector <student> wyszukaj, int ilosc, int indeks2 )
  51. {
  52.  
  53. }
  54.  
  55. int main()
  56. {
  57.  
  58. vector <student> osoba;
  59.  
  60. add_student( osoba, 2);
  61. display_student( osoba,2);
  62.  
  63. return 0;
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement