help for the program for water tank

Can you see a closing brace in main?
I can't
(The error message line numbers are dead accurate)

Then there's the confused scope rules