Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. #include <iostream>
  2. #include <string.h>
  3. #include <cstdlib>
  4.  
  5. using namespace std;
  6.  
  7. struct osoba {
  8. string imie;
  9. string nazwisko;
  10. int wiek;
  11. };
  12.  
  13. int main()
  14. {
  15. osoba uczniowie[5];
  16.  
  17. for (int i = 0; i<5; i++)
  18. {
  19. cout << "Podaj imie ucznia numer " << i+1 << endl;
  20. cin >> uczniowie[i].imie;
  21. cout << "Podaj nazwisko ucznia numer " << i+1 << endl;
  22. cin >> uczniowie[i].nazwisko;
  23. cout << "Podaj wiek ucznia numer " << i+1 << endl;
  24. cin >> uczniowie[i].wiek;
  25. }
  26.  
  27. for (int i = 0; i<5; i++)
  28. {
  29. cout << uczniowie[i].imie << " " << uczniowie[i].nazwisko << " " << uczniowie[i].wiek << endl;
  30. }
  31.  
  32. system("pause >nul");
  33.  
  34. return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement