UVa 10098 - Generating Fast

来源:互联网 发布:主机电源检测软件 编辑:程序博客网 时间:2024/05/16 17:24

传送门UVa 10098 - Generating Fast


一看这标题我就知道能水过。果然。

题意大家肯定都看得懂,不说了。

又是偷懒的做法。。

UVa挂了,不过应该没错。


#include <cstdio>#include <iostream>#include <algorithm>#include <string>using namespace std;int main(){    //freopen("input.txt", "r", stdin);    int n;    cin >> n;    while (n--)    {        string str;        cin >> str;        sort(str.begin(), str.end());        cout << str << endl;        while (next_permutation(str.begin(), str.end()))            cout << str << endl;        cout << endl;    }    return 0;}



0 0