Problem1Problem code: AX01 |
Number Mutations
Given a number, we can form number mutations in the following ways 1. The digits of the number should be arranged in descending order 2. The digits of the number should be arranged in ascending order 3. The number obtained in (2) must be subtracted from the number obtained in (1) to form a new number 4. Repeat these steps unless the new number has already appeared in a mutation Note that 0 is a permitted digit. The length of the mutation is the number of distinct numbers in the mutation. The program should read the numbers as input and should output the length of that mutation for each number read as an input.
Input
A sequence of positive numbers, all less than 10^9, each on its own line, terminated by 0, is the input. The input file contains at most 10 numbers.
Output
The output consists of their lengths exactly in the format indicated below.
Example
Input: 123456789 1234 444 0 Output: 2 4 2
| Author: | xpurgate |
| Date Added: | 3-09-2010 |
| Time Limit: | 1 sec |
| Source Limit: | 50000 Bytes |
| Languages: | C, CPP 4.0.0-8, CPP 4.3.2, JAVA |
Comments

Fetching successful submissions

you have to take input from
you have to take input from standard in.
the input file mentioned is the file containing the test data on the server.
Can someone explain this
Can someone explain this example?
Hey Admin, Why Cant we submit
Hey Admin,
Why Cant we submit solutions to these problems......Please take some steps so we could just try these problems.....