fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct Foo {
  5. string bar1;
  6. string bar2;
  7. friend istream& operator>>(istream& in, Foo& foo) {
  8. return in >> foo.bar1 >> foo.bar2;
  9. }
  10. };
  11.  
  12. int main() {
  13. Foo f;
  14. cin >> f;
  15. cout << f.bar1;
  16. return 0;
  17. }
Success #stdin #stdout 0s 3432KB
stdin
aleksander trzeci
stdout
aleksander