uva146 ID Codes

来源:互联网 发布:ipad版淘宝怎么开店 编辑:程序博客网 时间:2024/06/07 22:29

uva146  ID Codes

全排列的水题。 next_permutation 水过。。。

#include <algorithm>using namespace std;#include <stdio.h>#include <string.h>char sb[25];int main(){while(gets(sb) != NULL && sb[0] != '#'){if(next_permutation(sb, sb + strlen(sb)))printf("%s\n", sb);elseprintf("No Successor\n");}return 0;}


原创粉丝点击