Python3/백준 알고리즘
2022.02.21 [백준] (python 파이썬) 이진수 변환
ian's coding
2022. 2. 22. 00:02
728x90
반응형
https://www.acmicpc.net/problem/10829
10829번: 이진수 변환
첫째 줄에 자연수 N이 주어진다. (1 ≤ N ≤ 100,000,000,000,000)
www.acmicpc.net
풀이
1
2
3
4
5
6
7
8
9
10
|
n=int(input())
def dfs(x):
if x==0:
return
else:
dfs(x//2)
print(x%2,end='')
dfs(n)
|
cs |
728x90
반응형