Algorithm/BOJ 기초
[백준] 문자열 반복 2675 C++
hackyu
2019. 10. 2. 02:00
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | #include <iostream> #include <string> #include <algorithm> using namespace std; int main() { string str_T; getline(cin, str_T); int int_T; int_T = stoi(str_T); int temp_range; string a; for (int i = 0; i < int_T; i++){ getline(cin, a); temp_range = stoi(a); a.erase(0, 2); for (char c:a){ for (int j = 0; j < temp_range; j++){ cout << c ; } } cout << '\n'; } return 0; } | cs |