301915: CF363A. Soroban

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Soroban

题意翻译

给你一个整数 $N$ ($0$$\leq$$N$$\leq$$10^9$),要求你用算盘来表示 $N$ . 算盘分为左右两边,中间用`|`隔开,左边一颗珠子表示 $5$ ,共 $1$ 颗 ,右边一颗珠子表示 $1$ ,共 $4$ 颗。珠子用`O`表示,中间那根轴用`-`表示。 例如 $7$ 用算盘表示是:`-O|OO-OO` 注意表示数字时低位先输出低位,再输出高位(由低到高)

题目描述

You know that Japan is the country with almost the largest 'electronic devices per person' ratio. So you might be quite surprised to find out that the primary school in Japan teaches to count using a Soroban — an abacus developed in Japan. This phenomenon has its reasons, of course, but we are not going to speak about them. Let's have a look at the Soroban's construction. ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF363A/65453a8fa33e3e4687bf864e90866eed1c8c84d0.png)Soroban consists of some number of rods, each rod contains five beads. We will assume that the rods are horizontal lines. One bead on each rod (the leftmost one) is divided from the others by a bar (the reckoning bar). This single bead is called go-dama and four others are ichi-damas. Each rod is responsible for representing a single digit from 0 to 9. We can obtain the value of a digit by following simple algorithm: - Set the value of a digit equal to 0. - If the go-dama is shifted to the right, add 5. - Add the number of ichi-damas shifted to the left. Thus, the upper rod on the picture shows digit 0, the middle one shows digit 2 and the lower one shows 7. We will consider the top rod to represent the last decimal digit of a number, so the picture shows number 720. Write the program that prints the way Soroban shows the given number $ n $ .

输入输出格式

输入格式


The first line contains a single integer $ n $ ( $ 0<=n&lt;10^{9} $ ).

输出格式


Print the description of the decimal digits of number $ n $ from the last one to the first one (as mentioned on the picture in the statement), one per line. Print the beads as large English letters 'O', rod pieces as character '-' and the reckoning bar as '|'. Print as many rods, as many digits are in the decimal representation of number $ n $ without leading zeroes. We can assume that number 0 has no leading zeroes.

输入输出样例

输入样例 #1

2

输出样例 #1

O-|OO-OO

输入样例 #2

13

输出样例 #2

O-|OOO-O
O-|O-OOO

输入样例 #3

720

输出样例 #3

O-|-OOOO
O-|OO-OO
-O|OO-OO

Input

题意翻译

给你一个整数 $N$ ($0$$\leq$$N$$\leq$$10^9$),要求你用算盘来表示 $N$ . 算盘分为左右两边,中间用`|`隔开,左边一颗珠子表示 $5$ ,共 $1$ 颗 ,右边一颗珠子表示 $1$ ,共 $4$ 颗。珠子用`O`表示,中间那根轴用`-`表示。 例如 $7$ 用算盘表示是:`-O|OO-OO` 注意表示数字时低位先输出低位,再输出高位(由低到高)

加入题单

上一题 下一题 算法标签: