Bygoewn历年全国计算机等级考试_二级C语言上机考试题库及答案
printf("\nThe result: \n"); /**********found**********/
printf("\nName : %s, Age : %d\n", ___3___,max.age); } 修改
给定程序MODI1.c中函数fun的功能是:实现两个整数的交换 例如给a和b分别输入60和65,输出为:a=65 b=60 /**********found**********/ void fun ( int a, b ) { int t;
/**********found**********/ t = b; b = a ; a = t; } 设计
请编制一个函数fun,tt指向一个M行N列的二维数组,求二维数组每列中最小元素,并以此放入pp所指一维数组中。二维数组中的数已在主函数中赋予
15、B: *std std[i].age http://www.77cn.com.cn M: int *b t = *b; *b = *a ; *a = t; P: int i,j,
min, k ; for(i = 0 ; i < N ; i++) { min = tt[0][i] ; k = 0 ; for(j = 1 ; j < M ; j++) if(min > tt[j][i]) { min=tt[j][i] ; k = j ; } pp[i] = tt[k][i] ; } 16.填空
程序通过定义并赋初值的方式,利用结构体变量存储了一名学生的信息,函数fun
的功能是输出这位学生的信息 /**********found**********/ void show(STU ___1___) { int i;
printf("\n%d %s %c %d-%d-%d", tt.num, http://www.77cn.com.cn, tt.sex,
tt.birthday.year, tt.birthday.month, tt.birthday.day); for(i=0; i<3; i++)
/**********found**********/ printf("%5.1f", ___2___); printf("\n"); }
main( )
{ STU std={ 1,"Zhanghua",'M',1961,10,8,76.5,78.0,82.0 }; printf("\nA student data:\n"); /**********found**********/ show(___3___); } 修改
给定程序MODI1.c中函数fun的功能是:求出数组中最大数和次大数,并把最
大数和a【0】中的数对调,次最大数和a【1】中的书对调 int fun ( int * a, int n ) { int i, m, t, k ;