[백준] 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
[백준] 8958 - OX퀴즈 (파이썬) (C++)
[백준] 8958 - OX퀴즈 (파이썬) (C++)
2020.04.09N = int(input()) for i in range(N): score = 0 cnt = 0 result = input() for j in range(len(result)): if result[j] == 'O': cnt += 1 score += cnt elif result[j] == 'X': score += 0 cnt = 0 print(score) #include #include using namespace std; int main() { int num; cin >> num; int *save_total = new int[num]; for (int i = 0; i > answer; for..