Nothing looks insane to me. Considering your code is broken, it is not surprising that you are getting that many errors.
Just look at line 16: void DiviseContour();
You do not put a ;
at the end of the line when writing a method. This therefore breaks everything after it because the compiler will believe that everything is outside of any methods, and therefore is invalid.
Go through and fix your code, starting with that line and then see how many errors you get and fix them one at a time. It also looks like you have messed up the number of {
and }
so you also need to fix all of those up as I don’t think you have enough }
for the number of {
you have.
I would avoid wherever you got that code from as it looks like it is fundamentally broken.