日期:2014-05-20 浏览次数:20679 次
/** * @(#)lesson4_2.java * * * @author * @version 1.00 2008/4/29 */ import javax.swing.JOptionPane; import java.util.*; class ssssss // extends Arrays { public static void main(String args[]){ String number1; String number2; String number3; String number4; String number5; String number6; String number7; String number8; String number9; String number10; int num1,num2,num3,num4,num5,num6,num7,num8,num9,num10; int max,min; number1=JOptionPane.showInputDialog("aaa请输入第一个整数:"); number2=JOptionPane.showInputDialog("请ss输入第二个整数:"); number3=JOptionPane.showInputDialog("请输入第三个整数:"); number4=JOptionPane.showInputDialog("请输入第四个整数:"); number5=JOptionPane.showInputDialog("请输入第五个整数:"); number6=JOptionPane.showInputDialog("请输入第六个整数:"); number7=JOptionPane.showInputDialog("请输入第七个整数:"); number8=JOptionPane.showInputDialog("请输入第八个整数:"); number9=JOptionPane.showInputDialog("请输入第九个整数:"); number10=JOptionPane.showInputDialog("请输入第十个整数:"); num1=Integer.parseInt(number1); num2=Integer.parseInt(number2); num3=Integer.parseInt(number3); num4=Integer.parseInt(number4); num5=Integer.parseInt(number5); num6=Integer.parseInt(number6); num7=Integer.parseInt(number7); num8=Integer.parseInt(number8); num9=Integer.parseInt(number9); num10=Integer.parseInt(number10); int sum[]={num1,num2,num3,num4,num5,num6,num7,num8,num9,num10}; //java.util.Arrays.sort(sum); //sort(sum); Arrays a=new Arrays(); a.sort(sum); JOptionPane.showMessageDialog(null,"最大数是和最小数"+sum[9]+"----"+sum[0],"结果",JOptionPane.PLAIN_MESSAGE); System.exit(0); } }
/** * @(#)lesson4_2.java * * * @author * @version 1.00 2008/4/29 */ import javax.swing.JOptionPane; import java.util.*; class ssssss extends Arrays { public static void main(String args[]){ String number1; String number2; String number3; String number4; String number5; String number6; String number7; String number8; String number9; String number10; int num1,num2,num3,num4,num5,num6,num7,num8,num9,num10; int max,min; number1=JOptionPane.showInputDialog("aaa请输入第一个整数:"); number2=JOptionPane.showInputDialog("请ss输入第二个整数:"); number3=JOptionPane.showInputDialog("请输入第三个整数:"); number4=JOptionPane.showInputDialog("请输入第四个整数:"); number5=JOptionPane.showInputDialog("请输入第五个整数:"); number6=JOptionPane.showInputDialog("请输入第六个整数:"); number7=JOptionPane.showInputDialog("请输入第七个整数:"); number8=JOptionPane.showInputDialog("请输入第八个整数:"); number9=JOptionPane.showInputDialog("请输入第九个整数:"); number10=JOptionPane.showInputDialog("请输入第十个整数:"); num1=Integer.parseInt(number1); num2=Integer.parseInt(number2); num3=Integer.parseInt(number3); num4=Integer.parseInt(number4); num5=Integer.parseInt(number5); num6=Integer.parseInt(number6); num7=Integer.parseInt(number7); num8=Integer.parseInt(number8); num9=Integer.parseInt(number9); num10=Integer.parseInt(number10); int sum[]={num1,num2,num3,num4,num5,num6,num7,num8,num9,num10}; //java.util.Arrays.sort(sum); sort(sum); //Arrays a=new Arrays(); // a.sort(sum); JOptionPane.showMessageDialog(null,"最大数是和最小数"+sum[9]+"----"+sum[0],"结果",JOptionPane.PLAIN_MESSAGE); System.exit(0); } }