#include<cstdio> #include<iostream> using namespace std; int main() { int k,y=1; while(scanf("%d",&k)&&k!=0) { int a,b,c,d,e,f,number[k],i; if(y>1)printf("\n"); y=2; for(i=0;i<k;i++)scanf("%d",&number[i]); for(a=0;k-a>5;a++) { for(b=a+1;k-b>4;b++) { for(c=b+1;k-c>3;c++) { for(d=c+1;k-d>2;d++) { for(e=d+1;k-e>1;e++) { for(f=e+1;k-f>0;f++) { printf("%d %d %d %d %d %d\n",number[a],number[b],number[c],number[d],number[e],number[f]); } } } } } } } return 0; }
No comments:
Post a Comment