2019-05-05 12:56:13 C++

C++

Copy Copied! Full
#include <bits/stdc++.h> using namespace std; int main(void){ int N,K; cin >> N >> K; int A[N]; for(int i=0;i<N;i++)cin>>A[i]; do{ for(int i=0;i<K;i++){ cout << A[i] << " "; } cout << endl; }while(next_permutation(A,A+K)); return 0; }
RECOMMEND