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