2014-07-10 01:57:37

题意&思路:不赘述,直接next_permutation。

 1 #include <cstdio>
 2 #include <cstring>
 3 #include <algorithm>
 4 #include <iostream>
 5 using namespace std;
 6 
 7 int main(){
 8     char s[55];
 9     while(scanf("%s",s) == 1){
10         if(s[0] == '#') break;
11         if(next_permutation(s,s + strlen(s))) cout << s;
12         else cout << "No Successor";
13         puts("");
14     }
15     return 0;
16 }
17     

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-25
  • 2022-12-23
  • 2021-11-12
  • 2022-03-10
猜你喜欢
  • 2021-06-26
  • 2021-12-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案