fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. template<typename T1, typename T2>
  5. auto f(T1 const& a, T2 const &b)
  6. {
  7. if (a > b) return a-b;
  8. else return a+b;
  9. }
  10.  
  11.  
  12. int main()
  13. {
  14. cout << f(1, 2.) << endl;
  15. return 0;
  16. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
3