fork download
  1. #include <iostream>
  2. using namespace std;
  3. istream &operator<<(ostream& out, istream& in){
  4. int a = 0;
  5. in >> a;
  6. out << a << endl; //I added endl to make the input look nicer.
  7. in.unget();
  8. return in;
  9. }
  10.  
  11. int main()
  12. {
  13. int p1;
  14. cout << "Person 1: " << cin >> p1;
  15. cout << "Test: " << p1 << endl;
  16. return 0;
  17. }
Success #stdin #stdout 0s 16064KB
stdin
5
stdout
Person 1: 5
Test: 5