summaryrefslogtreecommitdiff
path: root/146/id.cpp
diff options
context:
space:
mode:
Diffstat (limited to '146/id.cpp')
-rw-r--r--146/id.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/146/id.cpp b/146/id.cpp
new file mode 100644
index 0000000..58698fa
--- /dev/null
+++ b/146/id.cpp
@@ -0,0 +1,15 @@
+#include <iostream>
+#include <string.h>
+#include <algorithm>
+
+int main(){
+ char s[50];
+ std::cin>>s;
+ while(s[0]!='#'){
+ if(std::next_permutation(s, s+strlen(s)))
+ std::cout<<s<<std::endl;
+ else
+ std::cout<<"No Successor\n";
+ std::cin>>s;
+ }
+}