#include <cstdio> #include <algorithm> #include <cstring> using namespace std; int main() { while(1) { char s[55]; gets(s); if(s[0] == '#') break; if (!next_permutation(s,s+strlen(s))) { puts("No Successor"); continue; } puts(s); } return 0; }
Monday, August 1, 2016
Published August 01, 2016 by Sourav Chowdhury with 0 comment
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment