2001年软考程序员下午试题[1]

程序员 责任编辑:fudjun 2010-01-26

添加老师微信

备考咨询

加我微信

摘要:试题一[函数1.1说明]函数strcmp()是比较两个字符串s和t的大小。若s<t函数返回负数;若s=t函数返回0;若s>t,函数返回正数。[函数1.1]intstrcmp(char*s,char*t){while(*s&&*t&&__(1)__){s++;t++;}return__(2)__;}[程序1.2说明]在n行n列的矩阵中,每行都有最大的数,本程序求

试题一

[
函数1.1说明]
函数strcmp()是比较两个字符串 s t 的大小。若 s < t 函数返回负数; s = t 函数返回0; s > t,函数返回正数。

[
函数1.1]
int strcmp(char *s,char *t)
{ while ( *s && *t && __(1)__){
s++;t++ ;
}
return __(2)__;
}

[
程序1.2说明]
n n 列的矩阵中,每行都有最大的数,本程序求这 n 个最大数中的最小一个。

[
程序1.2]
#include
stdio.h
#define N 100int a[N][N];
void main()
{ int row ,col ,max ,min ,n;
/*
输入合法 n (100 ),和输入 m ×n 个整数到数组 a 的代码略*/
for ( row = 0;row < n;row++) {
for ( max = a[row][0],col = l ;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);
}

[1]  [2]  [3]  [4]  [5]  [6]  [7]  [8]  

更多资料
更多课程
更多真题
温馨提示:因考试政策、内容不断变化与调整,本网站提供的以上信息仅供参考,如有异议,请考生以权威部门公布的内容为准!

软考备考资料免费领取

去领取