fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. template <class T>
  5. T timMin(T a, T b){
  6. return (a < b) ? a : b;
  7. }
  8.  
  9. int main(){
  10. int a = 5, b = 3;
  11. int c = timMin(a, b);
  12. float d = timMin(1.5, 2.3);
  13. PhanSo p1(1, 2);
  14. PhanSo p2(1, 3);
  15. PhanSo p3 = timMin(p1, p2);
  16. return 0;
  17. }
  18.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:13:2: error: ‘PhanSo’ was not declared in this scope
  PhanSo p1(1, 2);
  ^~~~~~
prog.cpp:14:8: error: expected ‘;’ before ‘p2’
  PhanSo p2(1, 3);
        ^~~
        ;
prog.cpp:15:8: error: expected ‘;’ before ‘p3’
  PhanSo p3 = timMin(p1, p2);
        ^~~
        ;
stdout
Standard output is empty