Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
58743 | teacher_wang | 全排列 | C++ | 通过 | 1 MS | 248 KB | 368 | 2024-12-15 15:13:41 |
#include<bits/stdc++.h> using namespace std; int main() { int n; string s; // ① 创建原字符序列 cin>>s; n = s.length(); // ② 对序列子区间内的元素进行全排列 do{ // 对每一次排列只需要输出即可 cout<<s<<endl; }while(next_permutation(s.begin(),s.end())); return 0; }