Page. 1 / 12534
[내 메뉴에 추가]
| 작성자 |
|
||
|---|---|---|---|
| 작성일 | 2018-04-04 21:47:08 KST | 조회 | 794 |
| 제목 |
이거 코드 넘모 막막합니다. 셀프 넘버라는데 멀로 접근해야 할 지 모르게썽용
|
||
We define a ‘self-number’ denoted by d(n), which is a function that adds n and its each digit.
For example, d(75) = 75 + 7 + 5 = 87.
We can start from this number to create an infinite series such as n, d(n), d(d(n)), … For example, if you start with 33, the next number is 33 + 3 + 3 = 39, 39 + 3 + 9 = 51, and 51 + 5 + 1 = 57.
This way we can make the following sequence: 33, 39, 51, 57, 69, 84, 96, 111, 114, 120, 123, 129, 141, ...
Given a natural number N, write a program that prints the self-numbers less than 5N.
|
||
|
|
||
|
|
||
|
|
||
|
댓글을 등록하려면 로그인 하셔야 합니다.
로그인 하시려면 [여기]를 클릭하십시오.






디아3






