Simple problem. You put a semicolon in
int main(void); The correct structure is:
// code goes between curly braces
You also have a declaration statement,
int n; before the first brace.
The compiler assumes you mostly know what you are doing, so the two lines with main and int n which end in semicolons look like a function signature declaration and a global variable declaration to the compiler. (It assumes you know how to start main().) The first thing that looks out of place to the compiler (because of that semicolon) is the first curly brace.
You would benefit greatly from a review of how to structure a program.
If this answers your question, please click on the check to accept. Let's keep up on forum housekeeping. ;-)