zoj 1089 Lotto

#include "iostream"
#include "cstdio"
using namespace std;

int main()
{
	int num[14], n, i, a, b, c, d, e, f, flag = 0;
	while (cin >> n && n)
	{
		if (flag != 0)
			cout << endl;
		for (i = 0; i < n; i++)
			cin >> num[i];
		for (a = 0; a < n - 5; a++)
			for (b = a+1; b < n - 4; b++)
				for (c = b+1; c < n - 3; c++)
					for (d = c+1; d < n - 2; d++)
						for (e = d+1; e < n - 1; e++)
							for (f = e+1; f < n; f++)
							{
								printf("%d %d %d %d %d %d\n", num[a], num[b], num[c], num[d], num[e], num[f]);
							}
							flag++;
	}
}

你可能感兴趣的:(zoj 1089 Lotto)