> C++ exercise with natural numbers?(code blocks)?

C++ exercise with natural numbers?(code blocks)?

Posted at: 2014-12-18 
Get the number, natural numbers are positive integers,so use an int variable type.

Convert it to a string. I usually use snprintf to do this. Or you can just write your own conversion using mod and divide to extract the individual digits.

Loop through the string and print each digit twice.

I have to type in any natural number and the program should type out it with double digits. For example, you type in 159 and the program types out 115599. I tried counting the number of digits and I can get the last digit but how am I supposed to double and put it to the front? I am sorry if my English is awkward, it's not my first and I am also learning c++ in other language.

Thank you!