#CCBCHMOT0000021. Tích các chữ số (Product of Digits)
Tích các chữ số (Product of Digits)
Product of Digits
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
Given a nonnegative integer n, multiply all its decimal digits. A zero digit makes the product zero; n=0 has product zero.
Input
One integer n.
Output
Print the integer product of the decimal digits.
Subtasks
- Subtask 1 (20%): 0 <= n <= 99.
- Subtask 2 (30%): 0 <= n <= 100000.
- Subtask 3 (50%): 0 <= n <= 10^9.
Examples
Example 1
Input
234
Output
24
Explanation
Digits 4,3,2 multiply to 24.
Example 2
Input
105
Output
0
Explanation
The zero digit makes 105 equal zero.