#include<iostream> #include<stdio.h> #include<string> #include<cstring> #define maxn 150 using namespace std; char mapn[maxn][maxn]; int main() { char str[150]; while(gets(str)!=NULL) { int sum; for(int i=0;i<strlen(str);) { sum = 0; if(str[i] == ‘!‘) printf("\n"); while(str[i]>=‘0‘&&str[i]<=‘9‘)//数字累加,11累加为2 { sum += str[i] - ‘0‘; i++; } if(str[i] == ‘b‘) str[i] = ‘ ‘; for(int j=0;j<sum;j++) printf("%c",str[i]); i++; } printf("\n"); } return 0; }
时间: 2024-10-07 00:07:25