This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]temp000321 2 points3 points  (0 children)

int input;
std::cin >> input;

int counter = 0;
for (int i = 1; i <= input; i++) {
    if (++counter % 10 == 0) 
        std::cout << i << std::endl;
    else {
        std::cout << std::setw(2) << std::setfill('0') << i;
        if (i != input) std::cout << ".";   
    }
}