#K60137. Product of a List
Product of a List
Product of a List
You are given a list of integers. Your task is to compute the product of all elements in the list.
Note: If the list is empty, the product is defined as 1.
For example, given the list [1, 2, 3, 4], the product is 24.
This problem requires you to read input from standard input and output the result to standard output.
inputFormat
The first line contains a single integer n
which represents the number of elements in the list. If n > 0
, the second line contains n
space-separated integers.
If n
is 0, then the list is considered empty.
outputFormat
Output a single integer representing the product of all integers in the list.
## sample4
1 2 3 4
24