OK, now that the necessary roughness is out of the way, we can actually begin helping you.

I do have to admit that this is terrible code, and most likely cannot be remediated; but it would be remiss of me not to point out why it is bad, or else the OP won't learn from the experience.

Aside from the formatting issues, the main problem is repetitiveness; you have cut and pasted the same basic code, with only a trivial addition made to it at each step, roughly 20 times, jut in one section of the code alone. This entirely black of code could be replaced with a single for() loop about five lines long. Such repetition is found throughout the code, making it larger and harder to read across the baord.

Similarly, you have (as Phorce points out) created 20 variables with the name in the form x {nth} for what would normally be a 20 element array. Not only is this an exceedly bad naming convention, it limits how you can use the values compared to the equivalent array. Equally atrocious is the use of the n {letter} for what would again be a single 20-element array normally. In fact, the naming conventions use in the program are uniformly awful.

Still, as Deceptikon says, it is the completely lack of indentation that is really doing you in here, as it makes it well-nigh impossible to be certain how the braces match to each other. Even if one is disinclined to indent their code themselves, virtually any modern editor will support either auto-indent, or an block-indenting feature, and most provide both. If all else fails, you can use a stand-alone program such as program such as astyle, after the fact. Lack of indentation, and inconsistent indentation, are not excusable given the tools available today.

As for the specific error that is causing so much trouble, a quick run through AStyle does indeed show it clearly: you are failing to close the function dbase::todo() around line 409

of the source code (line 430 in your post).