输入样例:
H3el5o2
题解:
#include<bits/stdc++.h> using namespace std; char s[110]; string res ; int num; int main() { scanf("%s",s); for(int i=0;i<strlen(s);) { if((i+1<strlen(s))&&(s[i+1]>='0'&&s[i+1]<='9')) { for(int k=0;k<(s[i+1]-'0');k++) res+=s[i]; i+=2; } else { res+=s[i]; i++; } } cout<<res<<endl; }标签:std,char,int,题解,解码,蓝桥 From: https://www.cnblogs.com/LHJ822/p/17294096.html