Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int T,a[20],c=0,i,j,k,l,m,n;
- while(1){
- scanf("%d",&T);
- if(T==0)
- break;
- if(c!=0)
- printf("\n");
- c++;
- for(i=1;i<=T;i++){
- scanf("%d",&a[i]);
- }
- for(i=1;i<=T-5;i++){
- for(j=2;j<=T-4;j++){
- if(j<=i)
- continue;
- for(k=3;k<=T-3;k++){
- if(k<=j || k<=i)
- continue;
- for(l=4;l<=T-2;l++){
- if(l<=k || l<=j || l<=i)
- continue;
- for(m=5;m<=T-1;m++){
- if(m<=l || m<=k || m<=j || m<=i)
- continue;
- for(n=6;n<=T;n++){
- if(n<=m || n<=l || n<=k || n<=j || n<=i)
- continue;
- printf("%d %d %d %d %d %d\n",a[i],a[j],a[k],a[l],a[m],a[n]);
- }
- }
- }
- }
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement