设为首页 加入收藏

TOP

mistake-输出前三名成绩(三)
2013-02-08 14:32:19 来源: 作者: 【 】 浏览:923
Tags:mistake- 输出 成绩

    // count(int s)函数的功能是返回值score数组中为s的元素的个数

    int count(int s)

    {

    int iCount=0;

    int i;

    for(i=0;i<num;i++)

    if(score[i]==s)iCount++;

    return iCount;

    }

    // output_index函数的功能是输出score数组中值为s的元素的下标(index)

    //注意:值为s的元素可能有多个

    void output_index(int s)

    {

    int i;

    for(i=0;i<num;i++)

    if(score[i]==s)cout《i《" ";

    return;

    }

    int firstthree(int max2,int max3)

    {

    for(i=0;i<num;i++)

    if(max2>score[i]&&max2<max)

    max2=score[i];

    if(max3>score[i]&&max3<max2)

    max2=score[i];

    return max,max2,max3;

    }

    [cpp] view plaincopyprint

        

首页 上一页 1 2 3 4 下一页 尾页 3/4/4
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇颜色对话框使用实例 下一篇A Round Peg in&n..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: