c++ program issues

void simon(int);

You can understand it as a statement in advance. Since c++ is compiled sequentially, your main function calls the simon function but the implementation of the simon function is written in Later, in order for the compiler to pass, a prior declaration must be given, so it is good to understand it.

void simon(int n)

This is the function header of the function simon. The content of the braces below is the function of the simon function.