SWEA(Python) 풀이/D3

SWEA[D3] (Python) 5601번 [Professional] 쥬스 나누기 풀이

개발윗미 2022. 6. 1. 18:29

Python으로 구현한 5601번 [Professional] 쥬스 나누기 문제 풀이입니다.

 

https://swexpertacademy.com/main/code/problem/problemDetail.do?problemLevel=3&contestProbId=AWXGAylqcdYDFAUo&categoryId=AWXGAylqcdYDFAUo&categoryType=CODE&problemTitle=&orderBy=FIRST_REG_DATETIME&selectCodeLang=PYTHON&select-1=3&pageSize=10&pageIndex=11 

 

SW Expert Academy

SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!

swexpertacademy.com


t = int(input())

for tc in range(1, t + 1) :
    n = int(input())
    result = f'1/{n} ' * n

    print('#%d %s' % (tc, result))

 

1. 각 테스트 케이스마다 '1/n ' 의 문자열을 n개 붙여 result에 할당한다.

 

2. 최종적으로 해당 테스트 케이스 번호와 함께 result 문자열을 출력한다.