CodeUp/코드업-1031~1035-python

cosmos·2021년 1월 27일
4
post-thumbnail

문제📖

1031

1032

1033

1034

1035

풀이🙏

1031

  • 10진수를 입력받는다.
  • 8진수로 출력하라.

1032

  • 10진수를 입력받는다.
  • 16진수로 출력하라.

1033

  • 10진수를 입력받는다.
  • 16진수 + 대문자로 출력하라.

1034

  • 8진수를 입력받는다.
  • 10진수로 바꾸어 출력하라.

1035

  • 16진수를 입력받는다.
  • 8진수로 바꾸어 출력하라.

코드💻

1031

import sys

num = int(sys.stdin.readline())

print("%o"%num)

1032

import sys

num = int(sys.stdin.readline())

print("%x"%num)

1033

import sys

num = int(sys.stdin.readline())

print("%X"%num)

1034

import sys

num = sys.stdin.readline()

result = int(num, 8)

print(result)

1035

import sys

num = sys.stdin.readline()

result = int(num, 16)

print("%o"%result)

결과😎

1031

1032

1033

1034

1035

출처📝

https://codeup.kr/problemsetsol.php?psid=23

0개의 댓글