#include "stdio.h"
void main( )
{ char str[80];
scanf("%s",str);
insert(str);
}
insert(char s[])
{
int i;
for(i=strlen(s);i>0;i--)
{ s[2*i]=s[i];
s[2*i-1]=' ';
}
printf("%s",s);
}
如果输入的字符串是abcd, 则程序的运行结果是 ( ) 。
A.
a
b
c
d
B. a c b d
C. a b c d
D. d
c
b
a
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346508.html
点击查看答案
有以下程序
#include
main()
{int a=2,b;
b=a<<2; printf(“%d\n”,b);
}
程序运行后的输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346516.html
点击查看答案
以数据块为单位对数据进行整体 读写时如果ptr是指向内存中数据块的首地址,fp是文件指针,那么数据块中每个数据项的大小为( )。
A. sizeof(*ptr)
B. *ptr
C. sizeof(ptr)
D. sizeof(*fp)
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346505.html
点击查看答案
有以下程序
#include "stdio.h"
#include "string.h"
void main( )
{ char str[100] ="How do you do";
strcpy( str + strlen(str)/2, "es she");
printf("%s\n", str);
}
执行后的输出结果是( )。
A. How do you do
B. es she
C. How are you
D. How does she
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346513.html
点击查看答案
下列程序段输出结果是( )。
a=1;b=10;
do{
b-=a;
a++;
}while(b--<0);
printf("a,b=%d,%d",a,b);
A. a,b=7,5
B. a,b=2,8
C. a,b=2,2
D. a,b=8,2
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e034650d.html
点击查看答案
以下程序调用findmax函数返回数组中的最大值
findmax(int *a,int n)
{ int *p,*s;
for(p=a,s=a; p-a
if (______) s=p;
return(*s);
}
main()
{ int x[5]={12,21,13,6,18};
printf("%d\n",findmax(x,5));
}
在下划线处应填入的是()。
A. p>s
B. *p>*s
C. a[p]>a[s]
D. p-a>p-s
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e0346511.html
点击查看答案
表示关系x<=y<=z的c语言表达式为()。
A. (X<=Y) & & (Y<=Z)
B. (X<=Y)AND(Y<=Z)
C. (X<=Y<=Z)
D. (X<=Y)&(Y<=Z)
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346513.html
点击查看答案
设有以下宏定义:
#define N 3
#define Y(n) ( (N+1)*n)
则执行语句:z=2 * (N+Y(5+1));后,z的值为()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346502.html
点击查看答案
有以下程序
main()
{int i,s=0,t[]={l,2,3,4,5,6,7,8,9};
for(i=0;i<9;i+=2)s+=*(t+i);
printf("%d\n",s);
}
程序执行后的输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346514.html
点击查看答案
以下叙述中不正确的是()。
A. 在C中,函数中的自动变量可以赋初值,每调用一次,赋一次初值。
B. 在C中,在调用函数时,实在参数和对应形参在类型上只需赋值兼容。
C. 在C中,外部变量的隐含类别是自动存储类别。
D. 在C中,函数形参可以说明为register变量。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034650d.html
点击查看答案