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

PROGRAMMING:Palindrome number

Luz5年前 (2021-05-10)题库549
Palindrome number is a very interesting number. It's the same for both sides, such as 123321 or 123454321. A single number and 0 are palindrome numbers. But we are familiar with palindrome numbers in decimal system. Now we make it more difficult to know whether a given number is palindrome numbers in other systems.
###Input format:
In one line, give the integers n and R of 2, where n is a positive integer no more than 10 to the power of 9, which is the number to be judged, R is the base, r = 10 is decimal, r = 2 is binary, and R is a positive integer no less than 2 to the power of 9 and no more than 10.
###Output format:
For each group of input, if n is the palindrome number in R system, then the first line will output "yes", otherwise, output "no". In the second line, each digit of N in R system will be given successively, with a space between the digits.
###Input sample 1:
Here is a set of inputs. For example:
```in
123321 10
```
###Output sample 1:
The corresponding output is given here. For example:
```out
Yes
1 2 3 3 2 1
```
###Input sample 2:
Here is a set of inputs. For example:
```in
123321 16
```
###Output example:
The corresponding output is given here. For example:
```out
No
1 14 1 11 9
```






answer:If there is no answer, please comment