PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Expressions matter
a = input().split() # Format: a b c
for i in range(len(a)):
a[i] = int(a[i]) # To sort
def bubble_sort(nlist):
# Sort the integers
for passnum in range(len(nlist)-1,0,-1):
for j in range(passnum):
if nlist[j]>nlist[j+1]:
nlist[j], nlist[j+1] = nlist[j+1], nlist[j]
bubble_sort(a) # We call the function
for i in range(len(a)):
a[i] = str(a[i]) # To evaluate
if a == ["1", "1", "1"]:
print(eval("("+a[0]+"+"+a[1]+")"+"+"+a[2]))
else:
print(eval("("+a[0]+"+"+a[1]+")"+"*"+a[2]))
"""
The idea behind this code is that using [+, *, (, )] the greatest value is given in this format:
(a+b)*c
Where a and b are the lowest values
And c is the greatest one
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run