-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUva441.cpp
More file actions
47 lines (44 loc) · 1.04 KB
/
Copy pathUva441.cpp
File metadata and controls
47 lines (44 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <iostream>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <sstream>
using namespace std;
int main()
{
int N;
int count=0;
while(cin>>N){
if(N==0)break;
if(count!=0){
cout<<endl;
}
vector<int> ints;
for(int i=0;i<N;i++){
int n;
cin>>n;
ints.push_back(n);
}
int Size=ints.size();
for(int i=0;i<Size;i++){
for(int j=i+1;j<Size;j++){
for(int k=j+1;k<Size;k++){
for(int n=k+1;n<Size;n++){
for(int c=n+1;c<Size;c++){
for(int l=c+1;l<Size;l++){
cout<<ints[i]<<" "<<ints[j]<<" "<<ints[k]<<" "<<ints[n]<<" "<<ints[c]<<" "<<ints[l]<<endl;
}
}
}
}
}
}
count++;
}
return 0;
}