选择题 以下fun函数的功能是将形参s所指字符串内容颠倒过来:
void fun(char*s)
{int i,j,k;
for(i=0,j=strlen(s)______; i<j;i++,j--)
{k=s[i];s[i]=s[j];s[j]=k;}
}
在横线处应填入的内容是______。
选择题 有以下程序:
#include <stdio.h>
main()
{ int k=33;
printf('%d,%o,%x\n',k,k,k);
}
程序的运行结果是______。
选择题 下列叙述中正确的是
选择题 下列程序的运行结果是______。
#include<stdio.h>
void fun(int*s,int*p)
{ static int t=3;
*p=s[t];
t--;
}
void main()
{ int a[]={2,3,4,5},k,x;
for(k=0;k<4;k++)
{ fun(a,x);
printf('%d,',x);
}
}
选择题 若有定义语句:int m[]={5,4,3,2,1},i=4;,则下面对m数组元素的引用中错误的是______。
选择题 下面程序的输出结果是( )。
main()
{struct m1{int a;int b;}en[2]={1,3,2,7);
printf('%d\n',en[0].b/en[0].a*en[1].a);
选择题 以下选项中合法的C语言赋值语句是______。
选择题 在传统流程图中,用来表示输入输出的图形是______。
选择题 有以下程序:
#include <stdio.h>
#include <string.h>
void fun(char *s[], int n)
{ char *t;
int i,j;
for(i=0; i<n-1; i+ +)
for(j=i+1; j<n; j+ +)
if(strlen(s[i]) > strlen(s[j]))
{t=s[i];s[i]=s[j];s[j]=t;}
}
main( )
{char *ss[]={'bcc','bbcc','xy','aaacc','aabcc'};
fun(ss,5);
printf('%s,%s\n',ss[0],ss[4]);
}
程序的运行结果是______。
选择题 若有以下程序:
#include <stdio.h>
main( )
{int a=1,b=2,c=3,d=4;
if((a=2) || (b=1))c=2;
if((c= =3) (d=-1))a=5;
printf('%d,%d,%d,%d\n',a,b,c,d);
}
则程序的输出结果是______。
选择题 有以下程序段:
FILE*fp;
if((fp=fopen('test.txt','w'))==NULL)
{printf('不能打开文件!');
exit(0);}
else
printf('成功打开文件!');
若指定文件test.txt不存在,且无其他异常,则以下叙述错误的是______。
选择题 若有以下程序段:
char str[4][12]={'aaa','bbbb','ccccc','dddddd'},*strp[4];
int i;
for(i=0;i<4;i++)strp[i]=str[i];
则以下错误引用字符串的选项是(其中0≤k<4)______。
选择题 若有以下说明,则______不是对strcpy库函数正确的调用。
strcpy库函数用于复制一个字符串:char*str1='abcd', str2[10], *str3='hijklmn', *str4[2], *str5='aaaa';
选择题 设有以下3个关系表,如表1~表3所示。
表1 关系表一
R
A
B
C
1
1
2
2
2
3
表2 关系表二
S
A
B
C
3
1
3
表3 关系表三
T
A
B
C
1
1
2
2
2
3
3
1
3
下列操作中正确的是______。
选择题 在一个C源程序文件中所定义的全局变量,其作用域为______。
选择题 有以下程序:
#include <stdio.h>
main()
{ char*mm[4]={'abcd','1234','mnop','5678'};
char** pm=mm;
int i;
for(i=0; i<4; i++) printf('%s',pm[i]+i);
printf('\n');
}
程序的运行结果是______。
选择题 下列数据结构中,属于非线性结构的是______。
选择题 下列程序段中完全正确的是______。
选择题对下列二叉树进行中序遍历的结果是______。
选择题 设有说明int s[2]={0,1),p=s;,则语句错误的是______。