In what concerns the continuous evaluation solving exercises grade during the semester, you should submit until 23:59 of October 26th
(this exercise will still be available for submission after that deadline, but without couting towards your grade)
[to understand the context of this problem, you should read the class #03 exercise sheet]
Numbers have personalities too! Some like to climb up in ascending order, while others prefer to slide down in a nice, orderly descent. But some numbers? Well, they just can't make up their mind and zigzag all over the place! Your task today is to determine if a number has its act together or if it's simply a chaotic mess.
Write a program that takes a positive integer number num and checks if its digits are arranged in a strictly ascending or descending order, or if the number is unordered.
The input consists of a single integer number, num.
The output should be a single line determining the order of the digits in the input number. The program should print one of the following statements:
The number is in ascending order.
The number is in descending order.
The number is not ordered.
The following limits are guaranteed in all the test cases that will be given to your program:
1 ≤ num ≤ 1010 | The input number must be a positive integer |
Example Input 1 | Example Output 1 |
1356 |
The number is in ascending order. |
Example Input 2 | Example Output 2 |
985 |
The number is in descending order. |
Example Input 3 | Example Output 3 |
96753 |
The number is not ordered. |