fork download
  1. #include <iostream>
  2. using namespace std;
  3. int a, b;
  4. void f(int &a, int b)
  5. {
  6. int c = a;
  7. a = b;
  8. b = c;
  9. }
  10. void f2()
  11. {
  12. f(b, a);
  13. //int b = a - 1;
  14. //f(a,b);
  15. }
  16. int main()
  17. {
  18. a = 5;
  19. b = 7;
  20. f2();
  21. cout << a << b;
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0.01s 5304KB
stdin
5 7
stdout
55