본문 바로가기
백준 알고리즘

파이썬) 백준 알고리즘 | 14175번 : The Cow-Signal

by 코딩새내기_ 2022. 1. 30.

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

 

14175번: The Cow-Signal

Bessie and her cow friends are playing as their favorite cow superheroes. Of course, everyone knows that any self-respecting superhero needs a signal to call them to action. Bessie has drawn a special signal on a sheet of M×N paper (1≤M≤10,1≤N≤10)

www.acmicpc.net

문제

Bessie and her cow friends are playing as their favorite cow superheroes. Of course, everyone knows that any self-respecting superhero needs a signal to call them to action. Bessie has drawn a special signal on a sheet of M×N paper (1≤M≤10,1≤N≤10), but this is too small, much too small! Bessie wants to amplify the signal so it is exactly K times bigger (1≤K≤10) in each direction.

The signal will consist only of the '.' and 'X' characters.

입력

The first line of input contains M, N, and K, separated by spaces.

The next M lines each contain a length-N string, collectively describing the picture of the signal.

출력

You should output KM lines, each with KN characters, giving a picture of the enlarged signal.

백준 14175 "The Cow-Signal" 문제입니다.

각 문자를 K배만큼 불려주면 되는 문제입니다.

import sys
M, N, K = map(int, sys.stdin.readline().split())
for _ in range(M):
    a = sys.stdin.readline().strip()
    for i in range(K):
        result = str()
        for j in range(len(a)):
            result += a[j] * K

        print(result)

댓글