close

#include"Sort_class03.def"

    Sort_class::Sort_class(int a1,int a2,int a3)
    {
        v[0]=a1;v[1]=a2;v[2]=a3;
    }

    void Sort_class:: mySort()
    {
        int i,j;
        for(i=3;i>0;i--)
        {
            for(j=0;j<i-1;j++)
            {
                if(v[j]<v[j+1])
                {
                    int temp;
                    temp = v[j];
                    v[j] = v[j+1];
                    v[j+1] = temp;
                }
            }
        }
        return;
    }

    void Sort_class:: Print_mySort()
    {
        mySort();
        int i;
        for(i=0;i<3;i++)
        cout<<v[i]<<endl;
    }

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 Kuihao 的頭像
    Kuihao

    溫暖午後的金針田__孕育有趣的創新

    Kuihao 發表在 痞客邦 留言(0) 人氣()