Advertisement
MeehoweCK

Untitled

Nov 2nd, 2020
2,002
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     string nazwisko[3];     // tworzymy tablicę trójelementową typu string
  8.  
  9.     // indeksy elementów tablicy zawsze numerujemy od 0!!!!
  10.  
  11.     cout << "Wpisz nazwiska klientow:\n";
  12.  
  13.     for(int i = 0; i < 3; ++i)
  14.     {
  15.         cout << "\tklient nr " << i + 1 << ": ";
  16.         cin >> nazwisko[i];
  17.     }
  18.  
  19.     cout << "Nazwiska klientow: ";
  20.     for(int i = 0; i < 3; ++i)
  21.         cout << nazwisko[i] << ", ";
  22.     cout << endl;
  23.  
  24.  
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement