Algorithm/Baekjoon
단계별로 풀기 8단계 수학 1 - 분수찾기(1193번 문제) Python3 답안
Bonita SY
2019. 10. 12. 20:13
728x90
코드)
input_num = int(input())
index = 2
cnt = 1
while cnt < input_num:
cnt += index
index += 1
index -= 1
cnt -= input_num
if index % 2 == 0:
son = index - cnt
mom = 1 + cnt
else:
son = 1 + cnt
mom = index - cnt
print(str(son)+"/"+str(mom))
문제)
https://www.acmicpc.net/problem/1193
1193번: 분수찾기
첫째 줄에 X(1 ≤ X ≤ 10,000,000)가 주어진다.
www.acmicpc.net
728x90