#include <iostream> 
using namespace std;

bool searchList(const int tickets[], int size, int winningNumber);

int main() {
    // array containing the player's 10 lucky numbers
    const int SIZE = 10;
    int playerTickets[SIZE] = {
        13579, 26791, 26792, 33445, 55555,
        62483, 77777, 79422, 85647, 93121
    };

    int winningNumber = 0;

    // Prompt the user to enter this week's winning combination
    cout << "Enter this week's winning 5-digit lottery number: ";
    cin >> winningNumber;

    // Check if any of the player's tickets match the winning number
    if (searchList(playerTickets, SIZE, winningNumber)) {
        cout << "Congratulations! One of your tickets is a winner this week!" << endl;
    } else {
        cout << "Sorry, none of your tickets matched the winning number this week." << endl;
    }

    return 0;
}

// Function Definitions

// Performs a simple linear search to find the winning number in the player's ticket array
bool searchList(const int tickets[], int size, int winningNumber) {
    for (int i = 0; i < size; i++) {
        if (tickets[i] == winningNumber) {
            return true; // Found a winning ticket
        }
    }
    return false; // No winning tickets found
}