Product of List Elements
A telescope shop sells magnifying adapters that screw into one another. Each adapter has its own whole-number factor, and a stack of them magnifies by all of those factors at once — an adapter with a factor of 0 is a lens cap and blanks the stack out completely. The website shows the combined factor of whatever stack a customer has put in the basket.
Task: Print the combined factor of the whole stack.
Input
A single line holding between 1 and 20 integers separated by single spaces. Each is one adapter's factor, and may be 0.
Output
One line holding a single integer — every factor on the line combined into one. A stack of a single adapter has that adapter's own factor.
Example:
Input:
1 2 3 4
Output:
24
Sign in to solve this problem
Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.
Sign in