Advertisement
rootuss

osobaaaa

Mar 3rd, 2017
409
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. struct osoba
  6. {
  7.    string imie;
  8.    string nazwisko;
  9.    int wiek;
  10. };
  11.  
  12.  
  13. int main()
  14. {
  15.  
  16.     osoba os[3];
  17.  
  18.     os[0].imie="Jan";
  19.     os[0].nazwisko="Kowalski";
  20.     os[0].wiek=12;
  21.  
  22.     os[1].imie="Adam";
  23.     os[1].nazwisko="Nowak";
  24.     os[1].wiek=5;
  25.  
  26.     os[2].imie="Olaf";
  27.     os[2].nazwisko="Nowicki";
  28.     os[2].wiek=55;
  29.  
  30.  
  31.     for(int i=0; i<3;i++)
  32.     {
  33.         cout<<os[i].imie<<" "<<os[i].nazwisko<<" "<<os[i].wiek<<endl;
  34.  
  35.     }
  36.     //cout<<"Twoje imie to: "<<jan.imie<<endl;
  37.     return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement