填空题以下程序中,for循环体执行的次数是 【11】 。 # define N 2 # define M N+1 # define K M+1*M/2 main() int i; for(i=1; i<K; i++) ... ...
填空题下面程序的输出结果是{{U}} 【15】 {{/U}}。
#define MAX 3
int a[MAX];
main()
{fun1();{un2(A) ;printf("/n");}
funl()
{ int k,t=0;
for(k=0;k<MAX;k++,t++)a[k]=t+t;
}
fun2(int b[])
{ int k;
for(k=0;k<MAX;k++)printf("%d",*(b+k));
}
填空题下面程序和运行运行结果是【 】。
typedef union student
{ char name [10];
long sno;
char sex;
float score [4];
} STU;
main ( )
{ STU a[5];
prinff( "% d/n", sizeof(a) );
}
填空题在线性结构中,队列的操作顺序是先进先出,而栈的操作顺序是 【2】 。
填空题52. 下列程序的输出结果是______。 #include<stdio.h> main() int x=3,y=2,z=1; if(x<y) if(y<0)z+0; else Z+=1; primf(“%d//n",z);
填空题以下程序的输出结果是【 】。
#include
main( )
{char a[]={′\1′,′\2′,′\3′,′\4′,′\O′};
printf("%d%d\n",sizeof(a),strlen(a));
}
填空题下面程序由两个源程序文件:t4.h和t4.c组成,程序编译运行的结果是:{{U}} [18] {{/U}}。
t4.h的源程序为:
#define N 10
#define t2 (x) (x*N)
t4.c 的源程序为:
#include <stdio.h>
#define M 8
#define f(x) ((x)*M)
#include "t4.h"
main()
{int i,j;
i=f(1+1); j=f2(1+1);
printf("%d%d/n",i,j);
}
填空题以下程序运行后的输出结果是 【7】 。 main() char m; m='B'+32; printf("%c/n",m);
填空题给定程序MODI1.C中函数fun的功能是:求出s所指字符串中最后一次出现的t所指字符串的地址,通过函数值返回,在主函数中输出从此地址开始的字符串。若未找到,则函数的返回值为NULL。例如,字符串s中的内容为“abcdabfabcdx”,若t中的内容为“ah”时,则输出结果为:abcdx;若t中的内容为“abd”,则程序输出未找到的信息:not be found!。 请改正程序中的错误,使它能得出正确的结果。 注意:不要改动main函数,不得增行或删行,也不得更改程序的结构。 文件MODI1.C内容如下: #include<stdio.h> #include<string.h> char *fun(char *s,char *t) char *p,*r,*a; /**********found**********/ a=NUll; while(*s) p=s;r=t; while(*r) /**********found**********/ if(r==P)r++;p++; else break; if(*r=='/0')a=s; s++: return a; void main( ) char s[100],t[100],*p; printf("/nPlease enter string s: "); scanf("%s",s); printf("/nPlease enter string t: "); scanf("%s",t); p=fun(s,t); if(P)printf("/nTbe result is: %s/n",p); else printf("/nNot found!/n");
填空题若有如下程序: main() int x=5,y,*t;t= y=++(*t); printf("%d,%d",x,y); 则程序执行后的x值为 【16】 ,y的值为 【17】 。
填空题如图所示二叉树的后序遍历的结果为______。
填空题当运行以下程序时,输入abcd,程序的输出结果是______。 insert(char str[]) int i; i=strlen(str); while(i>0) str[2*i]=str[i];str[2*i-1]='*';i--; printf("%s/n",str); main() char str[40]; scanf("%s/n",str);insert(str);
填空题已有定义如下: struct node int data; struct node *next; *p; 以下语句调用malloc函数,使指针p指向一个具有struct node类型的动态存储空间。请填空。 p=(struct node *)malloc({{U}} {{/U}});
填空题数据库技术的主要特点为数据的集成性、数据的高{{U}} 【4】 {{/U}}和低冗余性、数据独立性和数据统一管理与控。
填空题以下程序的输出结果是______。
#include <string.h>
main( )
{ printf("%d/n",strlen("IBM/n012/1//"));}
填空题给定程序中,函数fun的功能是在3×4的矩阵中找出在行上最大、在列上最小的那个元素,若没有符合条件的元素则输出相应信息。
例如,有下列矩阵:
1 2 13 4
7 8 10 6
3 5 9 7
程序执行结果为find:a[2][2]=9。
请在程序的下划线处填入正确的内容并把下划线删除,使程序得出正确的结果。
注意:源程序存放在考生文件夹下的BLANK1.C中。
不得增行或删行,也不得更改程序的结构!
给定源程序如下。
#include<stdio.h>
#define M 3
#define N 4
void fun(int(*a)[N])
{ int i=0,j,find=0,rmax,c,k;
while((j<M)c=0;
for(j=1;j<N;j++)
if(rmax<a[i][j]){
/*******found*******/
rmax=a[i][j];c=______;}
find=1;k=0:
while(k<M
k++;
}
if(find)printf("find:a[%d][%d]=%d/n",i,c,a[i][c]);
/***********found********/
______;
}
if(!find)printf("not found!/n");
}
main()
{ int x[M][N],i,j;
printf("Enter number for array:/n");
for(i=0;i<M;i++)
for(j=0;j<N;j++)scanf("%d",
printf("The array:/n");
for(i=0;i<M;i++)
{ for(j=0;j<N;j++)printf("%3d",x[i][j]);
printf("/n/n");
}
fun(x);
}
填空题有以下程序: #include main() int a[]=[1,2,3,4],Y,*p=&a[3]; --p;Y=*p;printf(“Y=%d/n”,Y); 程序的运行结果是 (14) 。
填空题以下程序的功能是:输出100以内(不含100)能被3整除且个位数为6的所有整数,请填空。 #include <stdio.h> main() int i,j for(i=0;{{U}} {{/U}};i++) j=i*10+6; if({{U}} {{/U}})continue: Printf("%d”",j);
填空题若定义#define PI 3.14159,则执行完下列程序后输出结果是______。 #definePI 3.14159;printf("PI=%f',PI);
填空题下面程序的运行结果是______。 #define N 10 #define s(x) x*x #define f(x) (x'x) main() int i1,i2; i1-1000/s(N); i2=1000/f(N); printf("%d %d/n",i1,i2);
