[백준] 1193번 : 분수찾기 - Python(파이썬)

강재원·2022년 10월 6일
0

[코딩테스트] Python

목록 보기
105/200




https://www.acmicpc.net/problem/1193

n=input()
n=int(n)
i=0
while True:
    if n>i:
        n-=i
        i += 1
    else:
        if i%2==1:
            print("%d/%d" % (i+1-n,n))
        else:
            print("%d/%d" % (n,i+1-n))
        break
profile
개념정리 & 문법 정리 & 알고리즘 공부

0개의 댓글