#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
Unknown
Studying at Shahjalal University of Science and Technology, Sylhet.
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment