n the given example, N = 3 and the input integers are 2, 3, and 7.So, the output should be 2 x 3 x 7 = 42.
N = int(input())
l = list(map(int, input().split()))
foo = 1
s = ''
for i in l:
foo*=i
s = s + (str(i)+'x')
print(s[:-1]+'='+str(foo))
Sample Input 1:
3
2 3 7
Sample Output 1:
2x3x7=42
Sample Input 2:
4
1 2 3 4
Sample Output 2:
1x2x3x4=24
Comments
Leave a comment