본문 바로가기

BOJ

[백준] 2675번 문자열 반복 c++

#include <iostream>

using namespace std;

int main(void) {
	ios::sync_with_stdio(NULL);
	cin.tie(NULL);
	cout.tie(NULL);

	int num,number;
	string str;
	cin >> num;
	for (int i = 0; i < num; i++) {
		cin >> number >> str;
		for (int j = 0; j < str.length(); j++) {
			for (int k = 0; k < number; k++) {
				cout << str[j];
			}
		}
		cout << "\n";
	}
	return 0;
}

'BOJ' 카테고리의 다른 글

[백준] 5543번 상근날드 c++  (0) 2020.04.26
[백준] 2884번 알람 시계 c++  (0) 2020.04.26
[백준] 10809번 알파벳 찾기 c++  (0) 2020.04.26
[백준] 2523 별찍기-13 c++  (0) 2020.04.26
[백준] 2751번 수 정렬하기2 c++  (0) 2020.04.26