Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
146
SUBMITTED BY:
Guest
DATE:
Dec. 25, 2013, 3:07 p.m.
FORMAT:
Text only
SIZE:
330 Bytes
Raw
Download
Tweet
HITS:
2323
Go to comments
Report
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int main()
{
char id[51];
while (scanf("%s", id) && id[0] != '#')
{
if (next_permutation(id, id+strlen(id)))
printf("%s\n", id);
else
printf("No Successor\n");
}
return 0;
}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus