1 #include <cstdlib> 2 #include <string> 3 #include <fstream> 4 #include <iostream> 5 6 7 #define INLINE inline __attribute__((always_inline)) 8 9 INLINE int 10 product (int x, int y) 11 { 12 int result = x * y; 13 return result; 14 } 15 16 INLINE int 17 sum (int a, int b) 18 { 19 int result = a + b; 20 return result; 21 } 22 23 int 24 strange_max (int m, int n) 25 { 26 if (m > n) 27 return m; 28 else if (n > m) 29 return n; 30 else 31 return 0; 32 } 33 34 int 35 foo (int i, int j) 36 { 37 if (strange_max (i, j) == i) 38 return product (i, j); 39 else if (strange_max (i, j) == j) 40 return sum (i, j); 41 else 42 return product (sum (i, i), sum (j, j)); 43 } 44 45 int 46 main(int argc, char const *argv[]) 47 { 48 49 int array[3]; 50 51 array[0] = foo (1238, 78392); 52 array[1] = foo (379265, 23674); 53 array[2] = foo (872934, 234); 54 55 return 0; 56 } 57