*6.5(对三个数排序)使用下面的方法头编写方法,按升序显示三个数:
public static void displaySortedNumbers( double num1, double num2, double num3)
编写测试程序,提示用户输入三个数字,调用方法以升序显示他们。
*6.5(Sort three numbers) Write a method with the following header to display three numbers in decreasing order:
public static void displaySortedNumbers( double num1, double num2, double num3)
Write a test program that prompts the user to enter three numbers and invokes the method to display them in decreasing order.
下面是参考答案代码:
public class SortThreeNumbersQuestion5 {
public static void main(String[] args) {
displaySortedNumbers(1, 2, 3);
displaySortedNumbers(