Specific answer:
You're not getting any matches because the probability of the first number you chose being the first random number generated out of however many is staggeringly small. You, as you guessed, need a loop or two to check all your numbers against all the randomly selected numbers.
General advice:
I'd suggest taking advantage of scope and not re-using the same variable all over the place. It's difficult to figure out what x is where and why.
So, instead of
1 2 3 4 5 6 7 8
|
int x;
...
for (x=0; x<some_thing; x++){...};
...
x=0;
...
if (x==...){...};
...
|
you'd write
1 2 3 4 5 6 7 8
|
...
for (int i=0; i<some_thing; i++){...};
...
int x=...;
if (x ==...){...};
...
for (int i=0;i<some_other_thing;i++){...};
...
|
The difference between this block and the other is that the 'i' goes out of scope and is deleted at the end of the for blocks. You can redeclare and initialize it elsewhere without worrying about losing data or causing problems with names.
Another good plan is to declare AND initialize variables at the same time immediately before they are used for the first time. Otherwise you end up with something like matchcount that gets declared in one place, initialized in another and used way further down without any rhyme or reason to it all.
Also, you really shouldn't litter your program with "magic numbers" -- constants like '80' or '81' whose purpose is indecipherable from context. Like, I have no idea why you're using 80. Is that a standard keno number? Did you pick it out of a hat? What does it even mean? You're better off declaring
const int some_short_but_descriptive_name_without_underscores = 80;
and then using that variable wherever you'd have used your magic numbers. That way it's easier to understand why those numbers are picked, and also easier for you to change them in the future -- all you have to do is change 80 in the declaration to some other number, rather than hunting and pecking through your code to find and change each one.
Take advantage of functions -- it's always a good idea to keep, say, interface stuff separate from actual math. Plus, it lets you reuse names without overlap because they get destroyed thanks to scope!
Oh, and final thing: vectors > arrays for like practically everything. Are there uses for arrays? Sure. Is this one of them? Nope. You'd have a way easier time with a container that self expands, knows its own size and isn't going to transform into a pointer seemingly at random!