设为首页 加入收藏

TOP

2011年计算机二级C语言上机操作题及答案(71)
2014-11-22 19:00:15 来源: 作者: 【 】 浏览:17
Tags:2011年 计算机 二级 语言 上机 操作 答案

#include


typedef struct


{


int num;


char name[10];


} PERSON;


void fun(PERSON ___1___)


{


___2___ temp;


if (std[0].num > std[1].num)


{


temp = std[0];


std[0] = std[1];


std[1] = temp;


}


if (std[0].num > std[2].num)


{


temp = std[0];


std[0] = std[2];


std[2] = temp;


}


if (std[1].num > std[2].num)


{


temp = std[1];


std[1] = std[2];


std[2] = temp;


}


}


main()


{


PERSON std[] = {5, "Zhanghu", 2, "WangLi", 6, "LinMin"};


int i;


fun(___3___);


printf("\nThe result is :\n");


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


printf("%d,%s\n", std[i].num, std[i].name);


}


填空题答案:


第一处:std[3] 或 std[] 或 *std


第二处:PERSON


第三处:std


编辑特别推荐:


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇2011年计算机二级C语言上机操作题.. 下一篇2011年计算机二级C语言上机操作题..

评论

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