diff options
| author | Aditya Naik | 2019-03-01 04:54:05 -0500 |
|---|---|---|
| committer | Aditya Naik | 2019-03-01 04:54:05 -0500 |
| commit | ede1a38950db4778b20573a05c8de50c2458c958 (patch) | |
| tree | afc4fd0b60d6618df0bb5cd16db1d622cdb069dd /146 | |
| parent | 032ffe90491fd692cead2c17db6ac0a1f6479d95 (diff) | |
146 AC
Diffstat (limited to '146')
| -rw-r--r-- | 146/id.cpp | 15 | ||||
| -rw-r--r-- | 146/in | 24 |
2 files changed, 39 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; + } +} @@ -0,0 +1,24 @@ +aaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaabcaaaaaaaaaaa +ghn +dqoggpbdrt +wlneeb +eeysvytn +bu +gar +izokc +dtbpihvjcz +ctldm +onuovwfrf +fri +u +olmviwa +oecbhqbvfx +aurubybsi +omecz +kxbuliympp +nu +z +gq +#
\ No newline at end of file |
