본문 바로가기
Beakjoon&프로그래머스/파이썬

[백준/파이썬]14490번 백대열

by 현장 2021. 7. 16.

-코드

from math import gcd
n, m = map(int, input().split(':'))
G = gcd(n, m)
print(f"{n//G}:{m//G}")