fork download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. template <typename T> T square(T v) { return v*v; }
  7. int f(int v) { return square(v); }
  8. double f(double v) { return square(v); }
  9.  
  10. class Shit
  11. {
  12.  
  13. };
  14.  
  15. int main()
  16. {
  17.  
  18. cout << f(4) << endl;
  19. cout << f(5.7) << endl;
  20.  
  21. return 0;
  22. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
16
32.49