CF32B.Borze
入门
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Ternary numeric notation is quite popular in Berland. To telegraph the ternary number the Borze alphabet is used. Digit 0 is transmitted as «.», 1 as «-.» and 2 as «--». You are to decode the Borze code, i.e. to find out the ternary number given its representation in Borze alphabet.
三进制数字表示法在 Berland 非常流行。为了电报传输三进制数,使用 Borze 字母表。数字 0 用 «.» 表示,1 用 «-.» 表示,2 用 «--» 表示。你需要解码 Borze 编码,即根据其 Borze 字母表表示形式还原出对应的三进制数。
输入格式
The first line contains a number in Borze code. The length of the string is between 1 and 200 characters. It's guaranteed that the given string is a valid Borze code of some ternary number (this number can have leading zeroes).
第一行包含一个 Borze 编码的数字。该字符串的长度在 1 到 200 个字符之间。保证给定字符串是某个三进制数的有效 Borze 编码(该三进制数可能含有前导零)。
输出格式
Output the decoded ternary number. It can have leading zeroes.
输出解码后的三进制数。它可能包含前导零。
输入输出样例
输入#1
.-.--
输出#1
012
输入#2
--.
输出#2
20
输入#3
-..-.--
输出#3
1012
输入解题思路,AI测评打分。不知道怎么写?