Since this is apparently a general C++ thread now, I'll offer some other advice. r1, r2, r3 etc. are very bad choices for variable names. If something stores the modulus of 5, call it at bare minimum "modulus_of_5". If something is a countdown variable, "countdown" is much better than "cd". If you named your variables like this, you wouldn't even need most of the comments you have in your code there. We call it "self-documenting".
I do it, Remainder 1 etc.. the shorter the variable name, the less likely I am to type something wrong.

Comments should never say WHAT your code is doing. If you can't tell what you're doing in the code just by reading the code, the code probably needs to be rewritten or clarified. Comments should say things like 1) Overall purpose / summary of entire blocks or functions 2) WHY you're doing something (not WHAT you're doing or HOW you're doing it), 3) Anything happening that's subtle or not immediately obvious, 4) Assumptions that are being made about input/output, which your code relies upon. Endless has good comments above. Source code is meant for human beings to read. Machines only understand binary. Good code = easy to read code.
Our teacher wants us to comment everything.

I can't argue with the rest, I welcome any and all advice, since I'm not good at C++, I just like doing it.