Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <vector>
- using namespace std;
- struct student
- {
- string imie;
- string nazwisko;
- string plec;
- int pesel;
- int indeks;
- };
- void display_student(vector <student> ktos, int ilosc)
- {
- for( int i=0; i<ilosc; i++)
- {
- cout<<"Imie: "<<ktos[i].imie<<endl;
- cout<<"Nazwisko: "<<ktos[i].nazwisko<<endl;
- cout<<"Plec: "<<ktos[i].plec<<endl;
- cout<<"Pesel: "<<ktos[i].pesel<<endl;
- cout<<"Indeks: "<<ktos[i].indeks<<endl;
- }
- }
- void add_student( vector <student> &uczen, int ilosc )
- {
- for(int i=0; i<ilosc; i++)
- {
- uczen.push_back(student());
- cout<<"Imie: ";
- getline( cin, uczen[i].imie );
- cout<<"Nazwisko: ";
- getline( cin, uczen[i].nazwisko );
- cout<<"Plec: ";
- getline( cin, uczen[i].plec );
- cout<<"Pesel: ";
- cin>>uczen[i].pesel;
- cin.ignore();
- cout<<"Indeks: ";
- cin>>uczen[i].indeks;
- cin.ignore();
- }
- }
- int znajdz( vector <student> wyszukaj, int ilosc, int indeks2 )
- {
- }
- int main()
- {
- vector <student> osoba;
- add_student( osoba, 2);
- display_student( osoba,2);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement