1 solutions

  • 0
    @ 2023-11-23 19:49:48
    #include <bits/stdc++.h>
    using namespace std;
    int main()
    {
    	char s[105];
    	cin >> s;
    	int length = strlen(s);
    	for(int i = 0 ;i < length ;i++){
    		if(s[i + 1] >= '1' && s[i + 1] <= '9'){//如果出现了数字。 
    			for(char j = '1' ;j <= s[i + 1] ;j++){//打印出‘数字’个s[i]。 
    				cout << s[i];
    			}
    			i++;
    		}else {
    			cout << s[i];
    		}
    	}
    	return 0;
    }
    
    • 1

    Information

    ID
    6494
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    3
    Tags
    # Submissions
    52
    Accepted
    29
    Uploaded By