int getRes(string s){ // s == " 4162" s == "-+193" s == "716271jd19" stringstream ss; ss << s; int res = 0; ss >> res; return res; }