[백준] 4673 - 셀프 넘버 (파이썬 / C++)
[백준] 4673 - 셀프 넘버 (파이썬 / C++)
2020.04.09general = set(range(1, 10001)) change = set() for i in range(1, 10001): for j in str(i): i += int(j) change.add(i) result = general - change for i in sorted(result): print(i) #include using namespace std; bool selfnum[10001]; int main(void) { memset(selfnum, true, sizeof(selfnum)); for(int i=1; i