提交时间:2023-11-04 09:06:25
运行 ID: 108602
# include <bits/stdc++.h> using namespace std ; bool isu [10] ; int x ; int pln [10] ; void pl ( int k ) { if ( k == x + 1 ) { for ( int i = 1 ; i <= x ; i ++ ) { cout << pln [i] ; } cout << endl ; return ; } for ( int i = 1 ; i <= x ; i ++ ) { if ( !isu [i] ) { isu [i] = true ; pln [k] = i ; pl ( k + 1 ) ; isu [i] = false ; } } return ; } int main ( ) { cin >> x ; pl ( 1 ) ; return 0 ; }