提交时间:2023-10-05 18:48:18
运行 ID: 105242
#include <bits/stdc++.h> using namespace std; int main() { int num[9]={1,2,3,4,5,6,7,8,9},n,sum=0; cin>>n; do{ for(int i=0;i<n;i++){ cout<<num[i]; } cout<<endl; sum++; } while{ (next_permutation(num,num+n)); } cout<<sum<<endl; return 0; }