提交时间:2023-10-05 08:20:44
运行 ID: 105022
#include <iostream> #include <algorithm> 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; }