Advertisement
Guest User

Untitled

a guest
Sep 26th, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.16 KB | None | 0 0
  1.             #include <iostream>
  2.             #include <vector>
  3.             #include <string>
  4.      
  5.              struct Ziomek
  6.              {
  7.                 std::string
  8.                 imie,
  9.                 nazwisko,
  10.                 haslo;
  11.      
  12.                 friend std::ostream& operator<<(std::ostream& wyjscie, Ziomek& ziom)
  13.                 {
  14.                     wyjscie << "\nImie: " << ziom.imie;
  15.                     wyjscie << "\nNazwisko: " << ziom.nazwisko;
  16.                     wyjscie << "\nPasswd: " << ziom.haslo;
  17.                     return wyjscie;
  18.                 }
  19.      
  20.                 friend std::istream& operator>>(std::istream& wejscie, Ziomek& ziom)
  21.                 {
  22.                     wejscie >> ziom.imie;
  23.                     wejscie  >> ziom.nazwisko;
  24.                     wejscie >> ziom.haslo;
  25.                     return wejscie;
  26.                 }
  27.              };
  28.      
  29.      
  30.             int main()
  31.             {
  32.                 Ziomek spizganyZiom;
  33.      
  34.                 std::cout << "Podaj [imie] [nazwisko] [haslo]: ";
  35.                 std::cin >> spizganyZiom;
  36.                 std::cout << "\nPodales:";
  37.                 std::cout << spizganyZiom;
  38.      
  39.                 return 0;
  40.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement