随机组卷按大纲配比:判断 8 · 单选 20 · 填空 10 · 综合 2(共 40 题 · 80 分)
- 单选37 判断字符串a和b是否相等,应当使用______。做这题 →
- 单选38判断字符串s1是否大于字符串s2,应当使用______。做这题 →
- 单选39下面程序段输出两个字符串中对应相等的字符。请分析程序填空。 char x[]="programming"; char y[]="Fortran"; ini i=0; while (x[i]!='\0'&&y[i]!='\0') if (x[i]= =y[i]) printf("%c",______); else i++;做这题 →
- 单选40 下面描述正确的是_______。做这题 →
- 填空设有 static char str[]="Beijing";则执行 strcpy(str,"China");printf("%d\n",strlen(str));后的输出结果是____。做这题 →
- 填空函数 fMinNum 的形参 a 所指数组中只存放正整数,函数的功能是查找数组中最小值,并作为函数值返回。请补全代码。 c int fMinNum (int a[],int n){ int i, min; min=a[0]; for(i=n-1; i>0;i--) if(________>a[i]) min=________; return min; }做这题 →
- 填空当执行下面的程序时, 如果输入 ABC, 则输出结果是 ____。 c #include "stdio.h" #include "string.h" main() { char str[20]="0123456"; scanf("%s", str);strcat(str,"789"); puts(str); }做这题 →
- 单选若有以下说明: int a[12]={1,2,3, 4,5,6, 7,8,9, 10, 11, 12};char c='a',d, g;则数值为 4 的表达式是()做这题 →
- 单选在 C 语言中,引用数组元素时,其数组下标的数据类型允许是()。做这题 →
- 单选int x[2][3];,则以下关于二维数组 x 的叙述错误的是()。做这题 →
- 填空若二维数组a有m 列,则在a[i][j]前面的元素个数为_________。做这题 →
- 填空若有以下代码: \text {char} a [ 1 0 ] = " 1 2 3 5 6 7"; \text {char} b [ 1 0 ] = " a b c d e f g"; \underline{strcpy(a,b);} \text {printf} (" 0 % - 0 5 o", a [ b [ 4 ] - b [ b [ 5 ] - b [ 3 ] ]) - 3 2); 如有空格请使用小写字母 v 代表 请写出输出结果____。做这题 →
- 填空char a[20]="goodbye",b[5]="luck"; strcpy(a+(strlen(a)-strlen(b)),b);printf("%s",a);上述语句执行后的输出结果为____.做这题 →
- 填空以下语句的输出结果是____。 txt printf("%d\n", strlen("\t\"\085\xff\n"));做这题 →
- 填空执行 printf("%d\n", strlen("ABCD\t\\123");后输出的值是____。做这题 →
- 填空当执行下面的程序时,如果输入 ABC,则输出结果是 ____。 #include "stdio.h" #include "string.h" main() { char str[20]="0123456"; scanf("%s", str);strcat(str,"789"); puts(str); }做这题 →
- 单选若有以下说明: int a[12]={1,2,3, 4,5,6, 7,8,9, 10, 11, 12};char c='a',d,g;则数值为4的表达式是()做这题 →
- 单选下面是有关 C 语言字符数组的描述,其中错误的是____。做这题 →
- 填空以下程序中函数 f 的功能是将 n 个字符串,按由小到小的顺序进行排序。 #include <string.h> void fun(char str[][12],int num){ char tmp[15]; int i,j; for(i=0;i<num-1;i++) for (j=i+1;j<num;j++) if(strcmp(str[i],str[j])>0) { strcpy(tmp,str[i]); strcpy(str[i],str[j]); strcpy(str[j],tmp);} } javascript main(){ char p[][12]={"abc","cdef","aabdef","dcdbe","aabd"}; fun(p,5); printf("%d\n",strlen(p[0])); dart system("pause"); }做这题 →
- 单选在 C 语言中,引用数组元素时,其数组下标的数据类型允许是()。做这题 →
- 单选int x[2][3];,则以下关于二维数组 x 的叙述错误的是()。做这题 →
- 单选下述对C语言字符数组的描述中错误的是()。做这题 →
- 单选以下能对二维数组a进行正确初始化的语句是()。做这题 →
- 单选在 C 语言中,引用数组元素时,其数组下标的数据类型允许是()。做这题 →
- 填空数组名表示数组在内存的____。做这题 →
- 填空int a [8] = {11, 23, 45, 33, 7, 0, 8, 9}, 则数组的第 5 个元素表示为 ____ , 第五个元素的值为 ____ 。做这题 →
- 填空C 语言中, 数组元素的下标下限为 ____.做这题 →
- 填空字符串 \mathbf { h e l l o } 在内存中占用_____个存储单元。做这题 →
- 综合比较两个字符串。(不要用 strcmp) void main(){ char s1[20],s2[20]; int i;int result; gets(s1); gets(s2); ____; while( (s1[i]==s2[i])____(s1[i]!='\0') ) i++; result=____; printf("%d\n", result); }做这题 →
- 综合编写程序,在被调函数中删除一维数组中所有相同的数,使之只剩一个,数组中的数已按由小到大的顺序排列,被调函数返回删除后数组中数据的个数。例如: 原数组:22234456666789910101010 删除后:2345678910 #include <stdio.h> //函数首部,形参是数组,长度 int del(int array[ ], int n){ int i,j; for(i=0;i<n-1;i++){ if(array[i] == array[i+1]){ for(j=____________________;j<n;j++) array[j-1]=array[j]; ________; i--; } } return n; } void main(){ int a[]= {2,2,2,3,4,4,5,6,6,6,6,7,8,9,9,10,10,10,10}; int n= del(a, ______/sizeof(a[0])); int i; for(i=0;i<n;i++) printf("%d\t",a[i]); printf("\n"); system("pause"); }做这题 →
- 综合函数 fun 的功能是:逆置数组元素中的值。例如, n 给出数组中每个数组的个数, 则逆置后依次为:9、8、7、6、5、4、3、2、1。形参 n 给出数组中数据的个数。请在程序的下划处, ) 内容。 include <stdio.h> void fun(int a[], int n){ int i,t; i=0; while(i<____){ t=a[i]; a[i] = a[n-1-____]; a[____] = t; ________; }} main() { int b[9]={1,2,3,4,5,6,7,8,9}, i; printf("\nThe original data :\n"); for (i=0; i<9; i++) printf("%4d ", b[i]); printf("\n"); fun(b, 9); printf("\nThe data after invert :\n"); for (i=0; i<9; i++) printf("%4d ", b[i]); printf("\n"); getchar(); }做这题 →
- 综合有以下程序 #include <stdio.h> main(){ int a[4][4]={ {1,4,3,2},{8,6,5,7},{3,7,2,5},{4,8,6,1}}, i, k, t; for (i=0; i<3; i++) for (k=i+1; k<4; k++) if (a[i][i] < a[k][k]) { t=a[i][i]; a[i][i]=a[k][k]; a[k][k]=t;} for (i=0; i<4; i++) printf("%d,", a[0][i]); } 程序运行后的输出结果是____。做这题 →
- 综合程序段功能:冒泡排序(升序) int nums[10] = {4, 5, 2, 10, 7, 1, 8, 3, 6, 9}; int i, j; for (i = 0; i < len - 1; i++) { for (j = 0; j < _______; j++) { if (__________) { ________; } } }做这题 →
- 综合有以下程序 void sort(int_a[],int n){ int i;j,t; for(i=0;i<n-1;i+=2) for(j=i+2;j<n;j+=2) if(a[i]<a[j]){t=a[i];a[i]=a[j];a[j]=t;} } main() { int aa[10]={1,2,3,4,5,6,7,8,9,10},i; sort(aa,10); for(i=0;i<10;i++) printf("%d,",aa[i]); printf("\n"); } 其输出结果是 9,2,_,4,_,6,_,8,1,_,。做这题 →
- 综合下列程序为从小到大的冒泡排序,请补齐代码 | #include<stdio.h>#define N 10int main(){ int *a*[N]={10,9,6,7,4,8,1,2,3,5},*i*, *j*, *t*;for(*i*=0; ;*i*++){for(*j*=0; ;*j*++){if( ){ *t*=*a*[*j*];*a*[*j*]=*a*[*j*+1];*a*[*j*+1]=*t*;}}}printf("冒泡排序后的输出结果为:\\n");for(*i*=0;*i*<N;*i*++)printf("%4d",*a*[*i*]);printf("\\n");return 0;} | | --- |做这题 →
- 综合以下程序的功能是用选择法对数组数值排序。下述程序的运行结果为:456789 #include<stdio.h> void main(){ int a[6] = {9,8,7,6,5,4}; int i,j,min,t; int n = sizeof(a)/sizeof(a[0]); for(j=0;j<n-1;j++){ ________; for(i = ________;i<n;i++) if(a[min]>a[i]) ________; t = a[min]; a[min] = a[j]; a[j]=t; } for(i=0;i<n;i++) printf("%d\t",a[i]); printf("\n"); system("pause"); }做这题 →
- 单选下列选项中,能正确定义数组的语句是()做这题 →
- 单选若要定义一个具有 5 个元素的整型数组,以下错误的定义语句是()做这题 →
- 单选若有定义语句: int m[ ] = {5,4,3,2,1}, i = 4; 则下面对 m 数组元素的引用中错误的是 ( )做这题 →
- 单选以下数组定义中错误的是()做这题 →
- 单选以下选项中正确的语句组是() javascript做这题 →
- 单选下面是有关 C 语言字符数组的描述,其中错误的是()做这题 →
- 单选有以下程序 c #include c #include txt main() txt {char x[]="STRING"; javascript x[0]=0;x[1]='\0';x[2]='0'; txt printf("%d %d\n",sizeof(x),strlen(x)); }程序运行后的输出结果是()做这题 →
- 单选有以下程序 c #include c #include txt main() javascript {char a[20]="ABCD\0EFG\0",b[]="IJK"; txt strcat(a,b); printf("%s\n",a); }程序运行后的输出结果是()做这题 →
- 单选有以下程序 #include <stdio.h> c void fun(char *s) { while (*s) {if (*s%2==0) printf("%c",*s); s++;} } main() { char a[]={"good"}; fun(a);printf("\n"); 注意: 字母 a 的 ASCII 码值为 97, 程序运行后的输出结果是 ( )做这题 →
- 判断存储字符数组中的最后一个字符必须是'\0'。做这题 →
- 判断在 C 语言中,引用数组元素时,其数组下标的数据类型允许是任何类型的表达式。做这题 →
- 判断指数组的长度(数组中包含元素的个数),其值可以椒整数或变量。( )做这题 →
- 判断在C语言中引用数组元素时,其数组下标的数据类型允许是任何类型的表达式。做这题 →
- 判断若有一维数组名为 b_{i} 则 *(b + i) 与 b[i] 等价。做这题 →