0
我忘記了使用最簡單的方法對4個數字進行排序的代碼。我到處搜索這些代碼,但仍無法找到它。使用JOptionPane從最小到最大排序4個數字
這是我到目前爲止有:
import javax.swing.JOptionPane;
public class SortingNumbers
{
public static void main(String[] args)
{
String input;
double number1, number2, number3, number4, sort;
int lowest, middle1, middle2, highest
input = JOptionPane.showInputDialog("Enter first number");
number1 = Double.parseDouble(input);
input = JOptionPane.showInputDialog("Enter second numebr");
number2 = Double.parseDouble(input);
input = JOptionPane.showInputDialog("Enter third number");
number3 = Double.parseDouble(input);
input = JOptionPane.showInputDialog("Enter fourth number");
number4 = Double.parseDouble(input);
JOptionPane.showMessageDialog(null, sort);
System.exit(0);
}
}
而問題是...... – MaxZoom 2015-02-24 19:18:32
什麼是代碼number1-number4至少到最大的排序? sort =(this code); – thecodester 2015-02-24 19:20:40
Arrays.sort()?! – 2015-02-24 19:26:44