반응형
https://www.acmicpc.net/problem/17010
17010번: Time to Decompress
The output should be L lines long. Each line should contain the decoding of the corresponding line of the input. Specifically, if line i+1 of the input contained N x, then line i of the output should contain just the character x printed N times.
www.acmicpc.net
간단한 구현 문제였습니다.
📕 풀이방법
📔 입력 및 초기화
적절히 선언 후 입력 받습니다.
📔 정답출력
필요한 문자를 개수만큼 출력해줍니다.
📕 Code
#include <bits/stdc++.h>
using namespace std;
int t, n;
char c;
int main(){
cin >> t;
while(t--){
cin >> n >> c;
while(n--) cout << c;
cout << '\n';
}
}
*더 나은 내용을 위한 지적, 조언은 언제나 환영합니다.
'Algorithm > Implementation' 카테고리의 다른 글
(C++) - 백준(BOJ) 11648 : 지속 (0) | 2022.06.13 |
---|---|
(C++) - 백준(BOJ) 4589 : Gnome Sequencing (0) | 2022.06.12 |
(C++) - 백준(BOJ) 9848 : Gift (0) | 2022.06.09 |
(C++) - 백준(BOJ) 25238 : 가희와 방어율 무시 (0) | 2022.06.07 |
(C++) - 백준(BOJ) 23037 : 5의 수난 (0) | 2022.06.05 |