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

2 answers

I can give it in pseudocode.
(Sorting three numbers: a, b, and c)

if (a <= b) {
if (b < c) return {a, b, c};
else if (a < c) return {a, c, b};
else return {c, a, b};
}
else {
if (a < c) return {b, a, c};
else if (a < c) return {b, c, a};
else return {c, b, a};
}

2007-02-02 13:07:28 · answer #1 · answered by a r 3 · 0 0

Sorry, we can't do graphics here, only text, and a flowchart requires graphics.
However, I'd begin by assigning the first number as max, the second as min, and the third as middle.
Then set up a series of conditionals to compare them pairwise, to set them in their proper places.
There are links online to help you understand and write flowcharts, just put tutorial flowchart in your search window and choose the one that helps you the best.

2007-02-02 21:01:20 · answer #2 · answered by Joni DaNerd 6 · 0 0

fedest.com, questions and answers