-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuva441.cpp
58 lines (57 loc) · 1.31 KB
/
uva441.cpp
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
48
49
50
51
52
53
54
55
56
57
58
/*
* UVA 441 - Lotto
*/
#include <iostream>
#include <string>
#include <cctype>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <fstream>
#include <iomanip>
#include <map>
#include <stack>
using namespace std;
void solve(vector <int> &v)
{
for(int i = 0; i < v.size(); i++) {
for(int j = i+1; j < v.size(); j++) {
for(int k = j+1; k < v.size(); k++) {
for(int l = k+1; l < v.size(); l++) {
for(int m = l+1; m < v.size(); m++) {
for(int n = m+1; n < v.size(); n++) {
cout << v[i] << " ";
cout << v[j] << " ";
cout << v[k] << " ";
cout << v[l] << " ";
cout << v[m] << " ";
cout << v[n] << endl;
}
}
}
}
}
}
}
int main()
{
int n;
bool first = false;
while(1) {
cin >> n;
if(n == 0)
break;
if(first)
cout << endl;
first = true;
vector <int> v(n);
for(int i = 0; i < n; i++) {
cin >> v[i];
}
solve(v);
}
return 0;
}