#include<iostream> #include<string> #include<vector> #include<stack> using namespace std; vector<char> str; void fun(string temp, int begin) { //    cout << begin<<endl;     if (begin >= temp.size())     {            for (int i = 0; i < str.size(); i++)         {             cout << str[i];         }         cout <<' ';         return;     }     str.push_back(temp[begin]+'a'-'1');         fun(temp, begin + 1);         str.pop_back();                  if (begin + 1 < temp.size() && (temp[begin] < '2' || (temp[begin] == '2'&&temp[begin + 1] < '6')))         {             int a=(int)(temp[begin] - '0') * 10 + (int)temp[begin + 1]-'0';             str.push_back(a+'a'-1);                          fun(temp, begin + 2);             str.pop_back();                      } } int main() {       string temp;     while (cin >> temp)     {         fun(temp, 0);     } } 33%,忙着做后边,没检查出来
点赞 评论

相关推荐

点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务