/ Published in: C
max: compare two numbers withou using [if, switch, :?]
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// solution one // template <class T> T max(T a, T b){ } // solution two // template <class T> T max(T a, T b){ T num[2] = [a, b]; return num[a < b]; }