Ok it clearly is a problem with your loops and brackets not lining up. You can tell because
}while(gameover != true); (on line 187) lines up with your opening brace of main. Thats a big no no and i was thoroughly shocked that g++ didn't complain when i compiled it. Also your variable i is unused.
Also you have a ton of formatting errors in here. ie weird spacing and stuff doesnt line up properly. although it isn't necessary for the program to run it will make it a hundred time easier to find issues like this if you keep everything looking nice and neat.
lastly on lines 119 and 120 you have opening braces for absolutely no reason. Although they don't cause the compiler to complain it is an awful idea to use opening braces for absolutely no reason. Id also suggest that you consider break this up into more functions. Its generally easier to maintain and find parts if you have it broken up in nice clean functions.