Digit Counts in a Product
InterviewTime limit1sMemory limit128 MB
Given three 3-digit natural numbers, compute their product and count how many times each digit 0 to 9 appears in it.
- Level
Easy2 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
Three natural numbers A, B, and C are given. Multiply the three numbers, write the result in decimal notation, and determine how many times each digit from 0 through 9 appears.
Input
The first line contains A, the second line contains B, and the third line contains C. Each number is a natural number greater than or equal to 100 and less than 1000.
Output
On the first line, print how many times the digit 0 appears in the decimal representation of A × B × C. Then, from the second through the tenth line, print the counts for digits 1 through 9 in order, one count per line.