时间为 (60 分钟) C 语言(每题2 分,共20 分) 1 设x,y,z,t 均为int 变量,则执行以下语句后,t 的值为 1 x=y=z=1; t=++x||++y&&++z; 2 设j 为int 型变量,则下面for 循环语句的执行结果是 7,4 for(j=10;j>3;j--) { if(j%3)j--; --j;--j; printf("%d",j); } 3 执行一下程序段后,m 的值为15 int a[2][3]={{1,2,3} ,{4,5,6} } ; int m,*p; p=&a[0][0]; m=(*p)*(*(p+2))*(*(p+4));1*3*5 4 有以下程序 int fun(int x,int y,int *cp,int *dp) { *cp=x+y; *dp=x-y; } main() { int a,b,c,d; a=30; b=50; fun(a,b,&c,&d); printf("%d,"%d\n",c,d); } 输出结果是 80,-20; 5 有一下程序 #include "stdio
h" int abc(int u,int v); main() { int a=24,b=16,c; c=abc(a,b); printf("%d\n",c); } int abc(int u,int v) { int w; while(v) { w=u%v;u=v;v=w; } return u; } 输出结果是 8; 6 若有一下定义和语句 char *s1="12345",*s2="1234"; printf("%d\n",strlen(strcpy(s1,s2)); 则输出结果是 :内存出错 因为代码区的值不能更改;换成字符数组可以,因为在栈区 7 一下函数用来在w 数组中插入x,w 数组中的数已按由小到大顺序存放,n 所指存储单元中