Advertisement
Guest User

Untitled

a guest
May 22nd, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <conio.h>
  4. #include <string>
  5.  
  6. using namespace std;
  7.  
  8. struct uczniowe
  9. {
  10. string Imie;
  11. string Nazwisko;
  12. int wiek;
  13. };
  14.  
  15. int ilu;
  16. uczniowe* tab = new uczniowe[ilu];
  17.  
  18. int main()
  19. {
  20. cout << "ile uczniów chcesz wypisać? " << endl;
  21. cin >> ilu;
  22.  
  23. for (int i = 0; i < ilu; i++)
  24. {
  25. cout << "podaj imie" << endl;
  26. cin >> tab[i].Imie;
  27. cout << "podaj nazwisko" << endl;
  28. cin >> tab[i].Nazwisko;
  29. cout << "podaj wiek" << endl;
  30. cin >> tab[i].wiek;
  31. }
  32. for (int i = 0; i < ilu; i++)
  33. {
  34. cout << tab[i].Imie << endl;
  35. cout << tab[i].Nazwisko << endl;
  36. cout << tab[i].wiek << endl;
  37. }
  38.  
  39.  
  40. return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement