Tuesday, 15 March 2011

c - How to iterate through a given integer input, and give output of Largest to Smallest digits? -


According to the principle, how do I solve this problem

For example, if given If the input was 9536, the output would be 9653.

I want a way to add this usage, and in the cycle of each point and when finding a number that was larger than the rest, in the empty string R as the first 'character' Is stored.

I was able to solve it using PHP (my main language), but not C I am preparing for a laboratory situation and this experiment uses C as my main language, so I am trying to brush my basic skills

to help you Thanks

three steps:

  1. Read the input one character at a time Convert an integer and store it in an array of integers.
  2. Sort Array
  3. (now sorted) array

No comments:

Post a Comment