문제 링크 : https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PmkDKAOMDFAUq


문제의 저작권은 SW Expert Academy에 있습니다.



#include <iostream>
 
using namespace std;
 
int main(void) {
    int T, N;
    cin >> T;
 
    for(int t_case=0; t_case<T; t_case++) {
        cin >> N;
        char c[N];
        int k[N];
 
        for(int i=0; i<N; i++) {
            cin >> c[i];
            cin >> k[i];
        }
 
        cout << "#" << t_case+1 << "\n";
        int cutLine=0;
        for(int i=0; i<N; i++) {
            while(k[i] != 0) {
                cout << c[i];
                k[i]--;
                if(cutLine++ == 9) {
                    cout << "\n";
                    cutLine = 0;
                }
            }
        }
        cout << "\n";
    }
 
    return 0;
}
cs

'C & C++ > SW Expert Academy' 카테고리의 다른 글

SWEA 1940 - 가랏! RC카!  (0) 2018.04.28
SWEA 1945 - 간단한 소인수분해  (0) 2018.04.28
SWEA 1948 - 날짜 계산기  (0) 2018.04.28
SWEA 1954 - 달팽이 숫자  (0) 2018.04.28
SWEA 1959 - 두 개의 숫자열  (0) 2018.04.28

+ Recent posts