C++)
#include <iostream>
#include <string>
using namespace std;
int main(void) {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
while (t--) {
int n;
string temp;
cin >> n >> temp;
for (auto ch : temp) {
for (int i = 0; i < n; i++)
cout << ch;
}
cout << "\n";
}
return 0;
}
Python)
import sys
read = sys.stdin.readline
t = int(read().rstrip())
for _ in range(t):
n, temp = read().rstrip().split(" ")
n = int(n)
ans = ''
for ch in temp:
ans += (ch * n)
print(ans)'백준 1 > 기초' 카테고리의 다른 글
| [백준 10991] 별 찍기 - 16 (C++) (0) | 2020.12.05 |
|---|---|
| [백준 1157] 단어 공부 (C++/Python) (0) | 2020.12.05 |
| [백준 1152] 단어의 개수 (C++/Python) (0) | 2020.12.05 |
| [백준 10809] 알파벳 찾기 (C++/Python) (0) | 2020.12.05 |
| [백준 8958] OX 퀴즈 (C++/Python) (0) | 2020.12.05 |