394. 字符串解码
看见这个头疼,直接想到了编译原理的内容,后面看了答案,字符串头疼,下次注意了,这次记忆了
但是c++的字符串处理,我一直没有记住,不去记忆就记不住
stoi(string) 将字符串转化为int
stack的函数 pop() top() push() empty()
string + ,* , length()
拼接
string x="0123456789";
cout<
查看代码
class Solution {
public:
string decodeString(string s) {
string result = "";
string temp_num = "";
string temp_word = "";
stackstk;
stackitk;
int nums = 0;
int times = 0;
while(nums