fork download
  1. #include <iostream>
  2. int f(int &x, int &y)
  3. {
  4. int t;
  5. if (x<y)
  6. {
  7. t=x;
  8. x=y;
  9. y=t;
  10. }
  11. return x*y;
  12. }
  13.  
  14. int main()
  15. {
  16. int x;
  17. int y;
  18. std::cin>>x;
  19. std::cin>>y;
  20. std::cout<<f(x,y)<<", "<<x<<", "<<y<<std::endl;
  21. return 0;
  22. }
Success #stdin #stdout 0s 3100KB
stdin
2
3
stdout
6, 2, 3