题解 | #全排列#

全排列

https://www.nowcoder.com/practice/5632c23d0d654aecbc9315d1720421c1

#include <cstdio>
#include <algorithm>
#include<string>
using namespace std;
int main() {
    string s;
    char arr[7];
    while (scanf("%s",arr) != EOF) {
        string s = arr;
       printf("%s\n",s.c_str());
        for (s.begin(); next_permutation(s.begin(), s.end());) {
            printf("%s\n",s.c_str());
        }
        printf("\n");
    }
    return 0;
}

全部评论

相关推荐

点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务