Climbing的专栏

Life is limited, but art is long

huang ClimbingID:hpdlzu80100
3123次访问,排名2万外好友4人,关注者7
热爱生活,积极向上,流自己的汗,吃自己的饭!
hpdlzu80100的文章
原创 23 篇
翻译 0 篇
转载 5 篇
评论 1 篇
最近评论
diqizhan:很喜欢这个
文章分类
收藏
    相册
    存档
    软件项目交易
    订阅我的博客
    XML聚合  FeedSky
    订阅到鲜果
    订阅到Google
    订阅到抓虾
    订阅到BlogLines
    订阅到Yahoo
    订阅到GouGou
    订阅到飞鸽
    订阅到Rojo
    订阅到newsgator
    订阅到netvibes

    原创 数组排序的Java实现(Sorting of arrays implemented with Java)收藏

    新一篇: 自然对数e及e的x次方的计算(Calculation of natural exponent e and x power of e) | 旧一篇: 三角形构成判定(Judge whether 3 side lengths can form a triangle)

    //Find the largest 2 values in a set of values, using sorting algorithm
    //Java how to program, 5/e, chapter 4
    import javax.swing.*;
    public class ModifiedMaximum {
    public static void main(String args[])
    {
        
    int  MAX=10;
        
    int[] number=new int[MAX];
        
    int temp;
        String[] gradeText
    =new String[MAX];


    for (int counter=1;counter<=MAX;counter++)
    {
        gradeText[counter
    -1]=JOptionPane.showInputDialog("Enter Number of No."+counter);
        number[counter
    -1]=Integer.parseInt(gradeText[counter-1]);
    }

      
    for (int i=0;i<MAX;i++)
            
    for (int j=i+1;j<MAX;j++)
            
    if (number[i]<number[j])
                
    {temp=number[i];
                number[i]
    =number[j];
                number[j]
    =temp;
                }


    JOptionPane.showMessageDialog(
    null"The two largest number are: "+number[0]+" and "+number[1],"Maximum",JOptionPane.INFORMATION_MESSAGE);
    }

    }

     

    发表于 @ 2008年04月08日 10:05:00|评论(loading...)|编辑

    新一篇: 自然对数e及e的x次方的计算(Calculation of natural exponent e and x power of e) | 旧一篇: 三角形构成判定(Judge whether 3 side lengths can form a triangle)

    评论:没有评论。

    发表评论  


    登录
    Csdn Blog version 3.1a
    Copyright © Climbing