Advertisement
erfanul007

UVa 441

Nov 27th, 2018
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int T,a[20],c=0,i,j,k,l,m,n;
  5. while(1){
  6. scanf("%d",&T);
  7. if(T==0)
  8. break;
  9. if(c!=0)
  10. printf("\n");
  11. c++;
  12. for(i=1;i<=T;i++){
  13. scanf("%d",&a[i]);
  14. }
  15. for(i=1;i<=T-5;i++){
  16. for(j=2;j<=T-4;j++){
  17. if(j<=i)
  18. continue;
  19. for(k=3;k<=T-3;k++){
  20. if(k<=j || k<=i)
  21. continue;
  22. for(l=4;l<=T-2;l++){
  23. if(l<=k || l<=j || l<=i)
  24. continue;
  25. for(m=5;m<=T-1;m++){
  26. if(m<=l || m<=k || m<=j || m<=i)
  27. continue;
  28. for(n=6;n<=T;n++){
  29. if(n<=m || n<=l || n<=k || n<=j || n<=i)
  30. continue;
  31. printf("%d %d %d %d %d %d\n",a[i],a[j],a[k],a[l],a[m],a[n]);
  32. }
  33. }
  34. }
  35. }
  36. }
  37. }
  38. }
  39. return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement