咪咪妈咪贝贝哄
去百度文库,查看完整内容>内容来自用户:夜宿山寺2020年全国计算机等级考试二级c语言上机精选题库(共70套)第1套(填空题)给定程序中,函数fun的功能是:将行参指针所指结构体数组中的三个元素按num成员进行升序排列。请勿改动主函数main和其他函数中的任何内容,仅在横线上填入所编写的若干表达式或语句。#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);}(改错题)下列给定程序中,函数fun的功能是:求k!(k〈13〉,所求阶乘的值作为函数值返回。例如:若k=10,则应输出3628800。请改正程序中的错误,使它能得出正确的结果。注意:不要改动main函数,不得增行或删行,也不得更改程序的结构!#include #include long fun(int k){<
倩倩19860816
浮云!我是软件工程专业的,我虽然不用考,但是给好多人替考过,有不少重复,所以你们就做真题就行了,历年的!和考四六级一样,不会考c语言的真谛和思想的。都是模式化的东西。
优质考试培训问答知识库