Can you please past the solution here and put your problem as "solved" if you found a solution by your own?
I was not trying to be mean when I said that you should learn a bit more. The if statement was a basic condition, and you did not understand it. No offense.
I admire the fact that you are motivated and looking for how things work, but start with the begining (c++ basis, logic, etc) before.
It's fine when you ask questions of course, but the logic that I've put before is easy to understand.
Sorry if I offended you, that was not my purpose.
Good luck