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

PROGRAMMING:[cycle] [odd even balance number B --]

Luz5年前 (2021-05-10)题库436
Enter a positive integer, and then test whether the number is odd even balanced. The test method is: decompose each bit of the number. If the numbers of all the decomposed bits are divided into two groups according to odd and even numbers, and the numbers of the two groups are the same, then the original number is called odd even balanced number, otherwise it is not.
###Input format:
Enter a positive integer in the range of int.
###Output format:
If it is odd even balanced number, output yes, otherwise output no, output carriage return and line feed after output data, refer to the example for details.
###Input sample 1:
Here is a set of inputs. For example:
```in
eleven million two hundred and twenty-three thousand three hundred and forty-four
```
###Output sample 2:
The corresponding output is given here. Because after 11223344 is decomposed, there are four odd numbers of 1, 1, 3, 3 and four even numbers of 2, 2, 4, 4, so it is odd even balanced
```out
YES
```
###Input sample 2
Here is a set of inputs. For example:
```in
one million one hundred and twelve thousand two hundred and twenty-two
```
###Output sample 2:
The corresponding output is given here. Because 11223344 is decomposed, there are 3 odd words of 1, 1, 1 and 4 even numbers of 2, 2, 2, 2, so * * is not * * odd even balanced number
```out
NO
```







answer:If there is no answer, please comment