提交时间:2022-07-29 17:41:13
运行 ID: 54878
#include<bits/stdc++.h> using namespace std; int k,a[14]; int main(){ while(1){ cin>>k; if(k==0) break; for(int i=1;i<=k;i++) cin>>a[i]; for(int i1=1;i1<=k-5;i1++){ for(int i2=i1+1;i2<=k-4;i2++){ for(int i3=i2+1;i3<=k-3;i3++){ for(int i4=i3+1;i4<=k-2;i4++){ for(int i5=i4+1;i5<=k-1;i5++){ for(int i6=i5+1;i6<=k;i6++){ cout<<a[i1]<<" "<<a[i2]<<" "<<a[i3]<<" "<<a[i4]<<" "<<a[i5]<<" "<<a[i6]<<" "<<endl; } } } } } } cout<<endl; } return 0; }