Little Jay

[C++] 백준 2657번 문자열 반복 본문

알고리즘/BOJ

[C++] 백준 2657번 문자열 반복

Jay, Lee 2021. 3. 7. 23:34
#include <iostream>
#include <string>
using namespace std;

int main() {

	int testcase;
	cin >> testcase;
	for (int i = 0; i < testcase; i++) {
		int repeat;
		string s;
		cin >> repeat >> s;
		for (int k = 0; k < s.length(); k++) {
			for (int j = 0; j < repeat; j++) {
				cout << s[k];
			}
		}
		cout << "\n";
	}

	return 0;
}

'알고리즘 > BOJ' 카테고리의 다른 글

[C++] 백준 10818번 최소, 최대  (0) 2021.03.08
[C++] 백준 8958번 OX퀴즈  (0) 2021.03.08
[C++] 백준 2476번 주사위  (0) 2021.03.06
[C++] 백준 1284번 집 주소  (0) 2021.03.06
[C++] 백준 3052번 나머지  (0) 2021.03.06
Comments