APP下载
首页
>
IT互联网
>
信息技术知识竞赛c语言
搜索
信息技术知识竞赛c语言
题目内容
(
单选题
)
#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

答案:C

信息技术知识竞赛c语言
下面程序输出数组中的最大值,由s指针指向该元素.
main()
{ int a[10]={6,7,2,9,1,10,5,8,4,3,},*p,*s;
flr(p=a, s=a; p-a<10; p++)
if(_________)s=p;
printf("The max:%d",*s):
}
则在if语句中的判断表达式应该是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e034650c.html
点击查看题目
若i和k都是int类型变量,有以下for语句
  for(i=0,k=-1;k=1;k++) printf("*****\n");
下面关于语句执行情况的叙述中正确的是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346527.html
点击查看题目
下列标识符中不合法的是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346500.html
点击查看题目
有以下程序
#include
Main()
{int a=1,b=0;
if(--a) b++;
else if(a==0) b+=2;
else b+=3;
printf(“%d\n”,b);
}
程序运行后的输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e034651b.html
点击查看题目
有以下程序
#include
void ive(x,n)
int x[],n;
{ int t,*p;
p=x+n-1;
while(x{ t=*x;
*x++=*p;
*p--=t;
}
return;
}
void main()
{ int i,a[]={1,2,3,4,5,6,7,8,9,0};
ive(a,10);
for(i=0;i<10;i++)
printf("%d ",a[i]);
printf("\n");
}

执行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e034651e.html
点击查看题目
下程序运行后的输出结果是() 。
  #include
  main()
  { int a;
  a=(int)((double)(3/2)+0.5+(int)1.99*2);
  printf("%d\n",a);
  }
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346505.html
点击查看题目
有以下程序
#include
int f(int m)
{static int n=0;
n+=m;
return n;
}
main()
{int n=0;
printf(“%d,”,f(++n));
printf(“%d\n”,f(n++));
}
程序运行后的输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346512.html
点击查看题目
在一个C语言程序中()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4920-c089-2897e0346504.html
点击查看题目
以下程序有语法性错误,有关错误原因的正确说法是( )。
void main()
{
int G=5,k;
void prt_char();
......
k=prt_char(G);
......
}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e034651a.html
点击查看题目
有以下程序
int fun(int x[],int n)
{static int sum=0,i;
for(i=0;i<n;i++) sum+=x[i];
return sum;
}
main()
{int a[]={1,2,3,4,5},b[]={6,7,8,9},s=0;
s=fun(a,5)+fun(b,4);printf("%d\n",s);
}
程序执行后的输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346518.html
点击查看题目
首页
>
IT互联网
>
信息技术知识竞赛c语言
题目内容
(
单选题
)
手机预览
信息技术知识竞赛c语言

#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

答案:C

信息技术知识竞赛c语言
相关题目
下面程序输出数组中的最大值,由s指针指向该元素.
main()
{ int a[10]={6,7,2,9,1,10,5,8,4,3,},*p,*s;
flr(p=a, s=a; p-a<10; p++)
if(_________)s=p;
printf("The max:%d",*s):
}
则在if语句中的判断表达式应该是()。

A. p>s

B. *p>*s

C. a[p]>a[s]

D. p-a>p-

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e034650c.html
点击查看答案
若i和k都是int类型变量,有以下for语句
  for(i=0,k=-1;k=1;k++) printf("*****\n");
下面关于语句执行情况的叙述中正确的是( )。

A. 循环体执行两次 

B. 循环体执行一次 

C. 循环体一次也不执行

D. 构成无限循环

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346527.html
点击查看答案
下列标识符中不合法的是()。

A. s_name

B. _e

C. fox

D. 3DS

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346500.html
点击查看答案
有以下程序
#include
Main()
{int a=1,b=0;
if(--a) b++;
else if(a==0) b+=2;
else b+=3;
printf(“%d\n”,b);
}
程序运行后的输出结果是()。

A. 0

B. 1

C. 2

D. 3

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e034651b.html
点击查看答案
有以下程序
#include
void ive(x,n)
int x[],n;
{ int t,*p;
p=x+n-1;
while(x{ t=*x;
*x++=*p;
*p--=t;
}
return;
}
void main()
{ int i,a[]={1,2,3,4,5,6,7,8,9,0};
ive(a,10);
for(i=0;i<10;i++)
printf("%d ",a[i]);
printf("\n");
}

执行后的输出结果是( )。

A. 1 2 3 4 5 6 7 8 9 0

B. 0 9 8 7 6 5 4 3 2 1

C. 1 3 5 7 9 2 4 6 8 0

D. 0 8 6 4 2 9 7 5 3 1

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e034651e.html
点击查看答案
下程序运行后的输出结果是() 。
  #include
  main()
  { int a;
  a=(int)((double)(3/2)+0.5+(int)1.99*2);
  printf("%d\n",a);
  }

A. 3

B. 2

C. 0

D. 1

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346505.html
点击查看答案
有以下程序
#include
int f(int m)
{static int n=0;
n+=m;
return n;
}
main()
{int n=0;
printf(“%d,”,f(++n));
printf(“%d\n”,f(n++));
}
程序运行后的输出结果是()。

A. 1,2

B. 1,1

C. 2,3

D. 3,3

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346512.html
点击查看答案
在一个C语言程序中()。

A. main函数必须出现在所有函数之前

B. main函数可以在任何地方出现

C. main函数必须出现在所有函数之后

D. main函数必须出现在固定位置

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4920-c089-2897e0346504.html
点击查看答案
以下程序有语法性错误,有关错误原因的正确说法是( )。
void main()
{
int G=5,k;
void prt_char();
......
k=prt_char(G);
......
}

A. 语句void prt_char(); 有错,它是函数调用语句,不能用void说明

B. 变量名不能使用大写字母

C. 函数说明和函数调用之间有矛盾

D. 函数名不能使用下划线

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e034651a.html
点击查看答案
有以下程序
int fun(int x[],int n)
{static int sum=0,i;
for(i=0;i<n;i++) sum+=x[i];
return sum;
}
main()
{int a[]={1,2,3,4,5},b[]={6,7,8,9},s=0;
s=fun(a,5)+fun(b,4);printf("%d\n",s);
}
程序执行后的输出结果是()。

A. 45

B. 50

C. 60

D. 55

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346518.html
点击查看答案
试题通小程序
试题通app下载