给你一个分割字符串形式的数组的神器.
vector<int> getvec(string str){ vector<int> vec; string temp = ""; for(int i=0;i<str.length();++i){ if(!isdigit(str[i])){ if(temp.size() > 0) vec.push_back(toint(temp)); temp = ""; } else temp += str[i]; } if(temp.size() > 0) vec.push_back(toint(temp)); return vec; }