https://www.acmicpc.net/problem/5949
1 2 3 4 5 6 7 8 9 10 11 12 13 | def sol(s): answer = '' for i in range(-1, -len(s) - 1, -1): answer += s[i] if i % 3 == 0 and i != -len(s) : answer += ',' return answer[::-1] if __name__ == '__main__': s = input() print(sol(s)) | cs |
반응형
'python-algorithm' 카테고리의 다른 글
백준 7656 만능 오라클 (0) | 2023.12.06 |
---|---|
백준 30868 개표 (0) | 2023.12.04 |
백준 8892 팰린드롬 (1) | 2023.11.29 |
백준 10448 유레카 이론 (0) | 2023.11.28 |
백준 18141 Are They All Integers? (0) | 2023.11.28 |
댓글