POJ1731-Orders

http://poj.org/problem?id=1731

#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int main(void)
{
    char str[202];
    while(gets(str))
    {
        int n=strlen(str);
        sort(str,str+n);
        printf("%s\n",str);
        while(next_permutation(str,str+n))
           printf("%s\n",str);
    }
    return 0;
}
posted @ 2012-10-08 20:06  Yogurt Shen  阅读(156)  评论(0编辑  收藏  举报