알고리즘/백준 알고리즘

[백준] 백준 31907번 GIST 찍기 파이썬(Python)

코집사 2024. 6. 3. 10:53
반응형

@notepad_jj2

츄르사려고 코딩하는 코집사입니다.


1. [백준] 백준 31907번 GIST 찍기 파이썬(Python)

1) 문제번호 : 31907

 

2) 문제 출처

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

 

 

2. 풀이

- 이 문제는 K값만큼 문자열도 반복횟수도 반복 출력하면 되는 문제다.

 

3. 소스 코드

import sys
input = sys.stdin.readline

str_list = ['G...', '.I.T', '..S.']

K = int(input())

for temp in str_list : 
    
    temp_str = ''
    for j in range(len(temp)) : 
        temp_str += (temp[j] * K)
    
    for k in range(K) : 
        print(temp_str)

 

반응형