-->
当前位置:首页 > 题库

PROGRAMMING:Six turns

Luz5年前 (2021-05-10)题库545

"666" is a kind of network language, which means that someone is very powerful and we admire him very much. Recently, another number "9" has been derived, which means "6 turns over". It really means too much. If you think this is the highest level of power, it's wrong - the highest level at present is the number "27", because it's three "9s"!
Please write a program to translate those outdated sentences that can only express admiration with a series of "6666... 6" into the latest advanced expressions.
###Input format:
Input in a line to give a sentence, that is, a non empty string, composed of no more than 1000 English letters, numbers and spaces, to enter the end.
###Output format:
Scan the input sentence from left to right: if there are more than three consecutive 6 in the sentence, replace the consecutive 6 with 9; However, if there are more than 9 consecutive 6, replace the consecutive 6 with 27. Other contents are not affected and are output as is.
###Input example:
```in
it is so 666 really 6666 what else can I say 6666666666
```
###Output example:
```out
it is so 666 really 9 what else can I say 27
```







answer:If there is no answer, please comment