QOJ.ac

QOJ

実行時間制限: 2 s メモリ制限: 256 MB 満点: 100

#22762. 곱셈 지속성

統計

소들은 수를 가지고 게임을 한다. 예를 들어 6593과 같은 수에서 시작한다. 각 자리의 숫자(예를 들어 6, 5, 9, 3)를 추출하고 모두 곱하여 곱을 만든다(이 경우 $6 x 5 x 9 x 3 = 810$). 다시 같은 작업을 하면(예를 들어 $8 x 1 x 0$), 한 자리 수인 0을 얻는다.

소들이 게임을 하도록 도와주자. 수를 읽고 한 자리 수가 될 때까지의 과정을 보여 주어라.

입력

시작 정수 $N$($10 \le N \le 2{,}000{,}000{,}000$).

출력

시작하는 수와 계산 과정에서 차례로 얻는 수들을 한 자리 수가 나올 때까지 정수로 한 줄에 출력한다.

예제

입력 1

98886

출력 1

98886 27648 2688 768 336 54 20 0

문제 작성자: Russ Cox

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.