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

PROGRAMMING:Half set

Luz5年前 (2021-05-10)题库428
Given a natural number n, starting from n, we can generate a half set in turn. The numbers in set (n) are as follows (note that half set is a multiple set).
1. n∈set(n);
2. Add a natural number to the left of N, but the natural number cannot exceed half of the number added recently;
3. Follow this rule until you can't add any more natural numbers.
For example, set (6) = {6,16,26126,36136}. There are six elements in half set (6).
###Input format:
A natural number n (0 < n < 1000)
###Output format:
The number of elements in half set set (n)
###Input example:
```in
six
```
###Output example:
```out
six
```






answer:If there is no answer, please comment