[Solved] Can you give me some suggestions on my problem?


I applaud your decision to follow your approach through.
Allow me to start a step-by-step answer according to the compromise described here (applicable to homework, challenges and very disciplined self-learners like you):
How do I ask and answer homework questions?

Step 1:
You program is able to look at digit by digit of the number in the right order (you can output them). But it does not get an overview of them. You do not store them. Neither separatly nor as a whole (string or number). Consider how to change that.
Do you know a way to store several seperate digits?
Do you know a way to store a string of characters?

Aleternatively, if you do not want to store the reordered digits, i.e. if you want to continue looking at single digits, then you need to always look at two single digits, one pair after the other. Each pair needs to consist of one digit from the high end and one digit from the low end. Maybe you can think of a way to start the number from both ends while looping. More variables to store intermediate results might help with this.

Step 2:
You “know a little bit of the way how to store a string of characters”, so do that. Store the characters which you output. If you do not know how to get from digit to character read up on sprintf(). This is a little complex, because the goal is to have a single string, not several strings with one digit each. So …

Alternatively, to store single digits as their own integers, read up on “arrays”. You specifically need an array of int.

If both seems to complicated do not forget the alternative from first step, to look at pairs of digits, from both ends of the number. For that try to print for example for the input “654321” the output “6:1, 5:2, 4:3”. If you can do that, things get much easier.

14

solved Can you give me some suggestions on my problem?