提交时间:2023-10-09 13:58:18
运行 ID: 106082
#include <iostream> #include <algorithm> using namespace std; int main() { int a[15] = {0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 }; int n; int sum = 0; cin >> n; do { for(int i = 1;i <= n;i++) cout << a[i]; cout << endl; sum++; }while(next_permutation(a + 1 , a + n + 1)); cout << sum; return 0; }