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