So I'm just getting started in C++ and need some help. I want to right a program that inputs a number as n and then outputs digits 0-9 based on n. Also each row adds one more number until the last number is the number of digits of n.

For example if n=8

output would be
1
12
123
1234
12345
123456
1234567
12345678

if n is greater than 9 it starts over at 0
so 1234567890123 for 13

I'm not looking for a code to be written for me. I just would like to know what i should write. I think i need to use k++ and count with a "while" loop. But when i try to use them all i get is an output that is wrong like

1
2
3
4
5
6 and so on

and how do i change the count to 0-9? When i go above 9 its put "10" instead of "0".

I want to implement undo logic which deletes the last drawn shape. To test this logic i had cleared shapes list and redrawn all shapes but still last ...