题目内容:
●试题二阅读下列程序或函数说明和C代码,将应填入(n)处的字句写在答题纸的对应栏内。
【函数2.1说明】
函数strcmp()是比较两个字符串s和t的大小。若s<t函数返回负数;若s=t函数返回0;若s>t,函数返回正数。
【函数2.1】
int strcmp(char *s,char *t)
{ while(*s && *t && (1) ){
s++;t++;
}
return (2) ;
}
【程序2.2说明】
在n行n列的矩阵中,每行都有最大的数,本程序求这n个最大数中的最小一个。
【程序2.2】
#includestdio.h
#define N 100
int a[N][N];
void main()
{ int row ,col,max,min,n;
/*输入合法n(<100),和输入n×n个整数到数组a的代码略*/
for (row=0;row<n;row++){
for(max=a[row][0],col=1;col<n;col++)
if( (3) )max=a[row][col];
if( (4) )min=max;
else if( (5) )min=max;
}
printf ("The min of max numbers is %d\n",min);
}
参考答案: