fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int check(int a, int &b){
  5. b += 2;
  6. if (a>b)
  7. return a;
  8. return a+b;
  9. }
  10.  
  11.  
  12. int main(){
  13. int x = 3, y = 2;
  14. if (x>y)
  15. cout << check(x,y) << endl;
  16. else
  17. cout << check(y,x) << endl;
  18. cout << x << " " << y << endl;
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
7
3 4