C++ 代码
#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
using namespace std;
int main()
{
string str;
cin >> str;
for(int i = 0 ; i < str.size() ; i ++ )
{
if(str[i] >= 'a' && str[i] <= 'z' || str[i] >= 'A' && str[i] <= 'Z')
{
if(str[i + 1] > '1' && str[i + 1] <= '9')
{
for(int j = 0 ; j <= str[i + 1] - '1'; j ++ )
printf("%c",str[i]);
}
else
printf("%c",str[i]);
}
}
return 0;
}