Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. struct Uczniowie {
  6. string imie[30];
  7. string nazwisko[30];
  8. string stanowisko[3];
  9. };
  10.  
  11.  
  12. void wypiszUczniow (Uczniowie uczniowieDoWypisania, int n) {
  13.  
  14. for (int i = 0; i < n; i++) {
  15. cout << i+1 << ". ";
  16.  
  17. cout << uczniowieDoWypisania.imie[i] << " " << uczniowieDoWypisania.nazwisko[i] << endl;
  18. }
  19. }
  20.  
  21.  
  22. int main() {
  23. setlocale(LC_ALL, "");
  24.  
  25. Uczniowie uczniowie;
  26. string decyzja = "T";
  27. int i = 0;
  28.  
  29. do {
  30. cout << "Podaj imie ucznia: ";
  31. cin >> uczniowie.imie[i];
  32. cout << "Podaj nazwisko ucznia: ";
  33. cin >> uczniowie.nazwisko[i];
  34.  
  35. cout << "Kolejny? T/N: \t";
  36. cin >> decyzja;
  37. i++;
  38. } while(decyzja == "T");
  39.  
  40. cout << endl;
  41.  
  42. wypiszUczniow(uczniowie, i);
  43.  
  44. return 0;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement