Inserting spaces between digits in C
问题 How would I go about taking a number like 123456 and having it print as 1 2 3 4 5 6 ? 回答1: As 'jamesdlin' has mentioned in his comment, GMan's approach would work, however you will need to store it in a buffer in order to print out in the correct order (his algorithm would print out "6 5 4 3 2 1" for input 123456). At this point I'd say that it would be much simpler to just use sprintf as 'therefromhere' suggested in his answer (if this is not an algorithm class assignment of course). In my