You add 1 to A and B after it checks the condition. The loop isn’t some eternal contract within itself; it just checks at the top whether to execute all the instructions inside it, then go to the top and check again.
You could move those instructions after the printing, but then you’d be printing 10 and 20, which you aren’t so far. Otherwise, put another check inside the loop before printing.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…