The C++ Program: lotto.cpp
1 #include <iostream>
2 #include <fstream>
3 #include <cstdlib>
4 #include <vector>
5 using namespace std;
6
7 int main()
8 {
9 ifstream infile("lotto.in");
10 ofstream outfile("lotto.out");
11
12 while (true)
13 {
14 int numTickets;
15 infile >> numTickets;
16 if (numTickets == 0)
17 return 0;
18
19 vector<bool> found(50);
20
21 int numFound = 0;
22 for (int i = 0; i < numTickets; i++)
23 for (int j = 0; j < 6; j++)
24 {
25 int number;
26 infile >> number;
27 if (!found[number])
28 {
29 found[number] = true;
30 numFound++;
31 }
32 }
33
34 if (numFound == 49)
35 outfile << "Yes" << endl;
36 else
37 outfile << "No" << endl;
38 }
39 return 0;
40 }