提交时间:2022-07-31 12:47:11

运行 ID: 55772

#include<bits/stdc++.h> using namespace std; int k,n[20],a,b,c,d,e,f; int main(){ while(cin>>k){ if(k==0) return 0; for(int i=0;i<k;i++) cin>>n[i]; for(a=0;a<+k-6;a++){ for(b=a+1;b<=k-5;b++){ for(c=b+1;c<=k-4;c++){ for(d=c+1;d<=k-3;d++){ for(e=d+1;e<=k-2;e++){ for(f=e+1;f<=k-1;f++){ cout<<n[a]<<" "<<n[b]<<" "<<n[c]<<" "<<n[d]<<" "<<n[e]<<" "<<n[f]<<endl; } } } } } } cout<<endl; } return 0; }