uva445

#include
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>


using namespace std;


void pp(int n, char ch){
    if(ch == 'b'){
        for(int i = 0; i < n; i++) printf(" ");
    }
    else{
        for(int i = 0; i < n; i++) printf("%c", ch);
    }
}
char str[150];
int main(){
    #ifdef LOCAL
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    #endif
while(gets(str)){
   //printf("%s\n", str);
   int pre = 0;
        //if(str[0] == 0) {printf("dddd\n");continue;}
        for(int i = 0; i < strlen(str); i++){
            if(isdigit(str[i])){
                pre = pre +(str[i] - '0');
            }
            if(!isdigit(str[i])){
                if(str[i] == '!') printf("\n");
                else {
                    pp(pre, str[i]);
                }
                pre = 0;
            }
        }
        printf("\n");
}
return 0;
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章