题目描述
没想到还有后面数字带1的样例,那还要数字干嘛,明明更长了……
思路
不如py可以直接用乘法
c++代码
#include <iostream>
using namespace std;
const int N = 1010;
string s,t;
int main()
{
cin >> s;
int n = (int)s.size();
for(int i = 0;i < n;i++)
if(s[i] >= '0' && s[i] <= '9')
{
string str(s[i] - '0' - 1,s[i - 1]);
t += str;
}else t += s[i];
cout << t << endl;
return 0;
}