Python 파이썬 2019. 10. 9. 13:04

십진수를 입력받아 2진수로 변환하여 출력하는 프로그램을 구현

 

[결과]

[코드]

 

print("10진수")
x = int(input())
y=""
print("2진수")
while x>0:
    y=str(x%2)+y
    x//=2
print(y)
    

posted by 스노(Snow)
: