English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

What are Well Ordered Numbers?
•An integer is considered well ordered if each digit value increases from left to right.
•For example, 123 is well-ordered because 1< 2 < 3, but 285 is not well-ordered because 8 > 5.
Instructions
•Write a program that will find and display all possible three digit well-ordered numbers.
•Your output should contain eight numbers per line, with a tab character between each number.
•Output should be in ascending order.
•No other output should be produced by your program other than the numbers.
Example Output
123 124 125 126 127 128 129 134
135 136 137 ??? ??? ??? ??? ???
...

2007-03-07 23:16:22 · 2 answers · asked by dora 1 in Computers & Internet Programming & Design

c++ language

2007-03-07 23:49:12 · update #1

2 answers

I will give you some hints and will request you to write the code yourself. And if you come across a problem, do ask it.

1) Run a loop from 100 to 999 including both of these.
2) User remainder operator (%) to separate each digit in number.
3) Compare if first digit is less then 2nd and 2nd is less then third, show according to your requirement.

Give it a try.

2007-03-08 00:43:03 · answer #1 · answered by Atif Majid 3 · 1 0

If you want code examples, it would be helpful to know what language you are wanting to use....

2007-03-08 07:22:12 · answer #2 · answered by dewcoons 7 · 1 0

fedest.com, questions and answers