Product of digits

Write a program that reads several numbers, and for each one prints the
product of its digits, and the product of the digits of the latest
product, etcetera, until the resulting product has just one digit.

Input

Input consists of several natural numbers.

Output

For every number, print the product of the digits of the number, the
product of the digits of the previous product, etcetera, one per line,
until the resulting product has just one digit. Print a line with 10
dashes after the output for every number.

Problem information

Author: Unknown
Translator: Salvador Roura

Generation: 2026-01-25T11:08:09.299Z

© Jutge.org, 2006–2026.
https://jutge.org
