Python으로 작성 했습니다.
test_case=int(input(""))
for idx in range(test_case):
num = int(input(""))
crease_num = 1;
save_set=[]
while True:
if crease_num >= num / 2:
print(f"Pairs for {num}:{','.join(save_set)}")
break
minus = num - crease_num
if crease_num + minus == num:
save_set.append(f" {crease_num} {minus}")
crease_num += 1
'development > 알고리즘' 카테고리의 다른 글
[프로그래머스] 성격 유형 검사하기 (0) | 2022.08.21 |
---|---|
[프로그래머스] 시저 암호 (0) | 2022.08.21 |
[프로그래머스] 같은 숫자는 싫어 (0) | 2022.08.21 |
[프로그래머스] 없는 숫자 더하기 (0) | 2022.08.19 |
[프로그래머스] 약수의 개수와 합 (0) | 2022.08.19 |