Just store your numbers in a list somewhere, then you can have as many as you want:
Code:
#include <cstdlib>
#include <iostream>
#include <string>
namespace {
int hit[][3] = {
{1, 2, 3},
{2, 2, 3},
{3, 2, 3},
};
}
int main()
{
std::string buf;
do {
int a = 1 + rand() % 3;
int b = 1 + rand() % 3;
int c = 1 + rand() % 3;
std::cout << a << ' ' << b << ' ' << c << std::endl;
// Check for a hit
for (std::size_t i = 0; i < sizeof hit / sizeof *hit; i++) {
if (a == hit[i][0] && b == hit[i][1] && c == hit[i][2]) {
std::cout << "Winner!" << std::endl;
}
}
std::cout << "Again? (EOF to quit): ";
} while (getline(std::cin, buf));
}