You forgot to assign a an initial value. Line 46 int a, b =0;
The only place I see numbers output is on lines 55 and 64 {cout<<a+b+1<<" "; break;}
This may be the whole issue.
Why not say it a tic-tac-toe game? Knowing what the program is trying to do helps with code reading and interpretation, especially with the unconventional code formatting in the main().
The code looks all crushed together.
sorry about that.
Welp, I changed my strategy to what I think is a more efficient one. I used a two-dimensional array instead. It's still a work in progress. I'll post it when I'm done.