Advertisement
juanjo12x

UVA_441_Lotto

Aug 10th, 2014
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.82 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <algorithm>
  4. #include <cstring>
  5. #include <string>
  6. #include <cctype>
  7. #include <stack>
  8. #include <queue>
  9. #include <list>
  10. #include <vector>
  11. #include <map>
  12. #include <set>
  13. #include <sstream>
  14. #include <stdlib.h>
  15. #include <cmath>
  16. #define LL unsigned long long
  17. using namespace std;
  18.  
  19. int main() {
  20.     int k;
  21.     int S[15];int cont=0;
  22.     while(scanf("%d",&k)){
  23.         if(k==0) break;
  24.         cont++;
  25.         if(cont>1) printf("\n");
  26.         for(int i=0;i<k;i++){
  27.             scanf("%d",&S[i]);
  28.         }
  29.         for(int a=0;a<k-5;a++){
  30.             for(int b=a+1;b<k-4;b++){
  31.                 for(int c=b+1;c<k-3;c++){
  32.                     for(int d=c+1;d<k-2;d++){
  33.                         for(int e=d+1;e<k-1;e++){
  34.                             for(int f=e+1;f<k;f++){
  35.                                 printf("%d %d %d %d %d %d\n",S[a],S[b],S[c],S[d],S[e],S[f]);
  36.                             }
  37.                         }
  38.                     }
  39.                 }
  40.             }
  41.         }
  42.     }
  43.     return 0;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement