Programming/코딩 문제 풀이
2020/04/17 코딩 문제 연습 (7단계 / 백준 2675번) C++
갓비니
2020. 4. 17. 23:35
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#include <iostream>
#include <string>
using namespace std;
int main() {
int count;
int repeat;
string word;
cin >> count;
for (int i = 0; i < count; i++) {
cin >> repeat;
cin >> word;
for (int j = 0; j < word.size(); j++) {
for (int k = 0; k < repeat; k++) {
cout << word[j];
}
}
cout << "\n";
}
}
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter
|
sizeof(word),,,
이것이 아니고
word.size()