At first glance, it looks like you have no opening brace for
int main()
.
Beyond that, I have found it very helpful
NOT to use the style
int main() {
}
Instead, I will use
int main()
{
}
Put the braces in their own column, indented from the block they start, line up the opening and closing braces and indent the code inside the block from the braces. When you have several pages of code to scan, you can simply pull out a pencil and a ruler and make sure everything lines up properly and that every opening has a closing.