试题通
试题通
APP下载
首页
>
文学知识
>
C语言程序设计题库
试题通
搜索
C语言程序设计题库
题目内容
(
单选题
)
30.下面程序运行后输出结果为________。
#include
int myf( )
{ if(n==1)return m;
else return m+myf(m, n-1);
}
int main()
{ int x=5, y=3; printf( return 0; }

答案:DNMYFXYXY

试题通
C语言程序设计题库
试题通
3.本程序的功能是:验证在7~2000之间的所有素数中存在这样的两个素数,它们的差恰好是1898。
#include
int main()
{ int i,j,a[1000],k=0,m,n,flag=0;
for(i=7;i<2000;i+=2)
{for(j=2;j<=i/2;j++)
if(j%i==0)( (6) );
if(j>i/2)
a[k++]=i;
}
for(i=0;i<k-1;i++)
for(j=1;j<k;j++)
if(( (7) )==1898)
{m=i;n=j;( (8) ); break;}
if( )
printf( );
else
printf( );
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f3-7690-c003-bc7499099f00.html
点击查看题目
1
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f6-8ba0-c003-bc7499099f01.html
点击查看题目
9.若有声明“double x=8, y=5;”,则计算xy的库函数调用形式是( )。
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3ef-f808-c003-bc7499099f02.html
点击查看题目
25.本程序的功能是:将一个字符串(串长不超过50)中连续的空格符值保留一个。例如,若字符串为“I am a student.”,处理后为“I am a student.”。
#include
#include
int main()
{char str[51]; int i;
gets( );
for(i=1; ( (64) ); i++)
if(str[i-1]==' '&&str[i]==' ')
{strcpy(str+i-1,( (65) ));
i--;
}
puts( );
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f4-64d8-c003-bc7499099f00.html
点击查看题目
16.下列程序运行时输出的结果是()。
#include
#include
int fun( )
{int k;
while( )
{k=abs( );
m=( )?n:m;
n=k;
}
return m;
}
int main( )
{printf("%d, %d\n", fun(9, 15), fun(9, 5));
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f5-9588-c003-bc7499099f00.html
点击查看题目
9.下面程序中函数delchar( )的功能是:将字符串s中出现的所有c字符删除。
void delchar( )
{ int j=0, k=0;
while(s[j] != '\0')
{if( )
{s[k] = s[j];
( (24) );
}
( (25) );
}
( (26) );
}
int main()
{ char ch[]="element",c='e';
delchar( );
puts( );
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f6-7818-c003-bc7499099f00.html
点击查看题目
1.( )0( )连续 数组名( )越界
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f4-7478-c003-bc7499099f00.html
点击查看题目
1.scanf() printf()2.%d %f %c 3.逗号 空格 回车符4.%ld
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f0-4240-c003-bc7499099f00.html
点击查看题目
42.下面程序在编译时在第4行报错“error C2082: 形参“m”的重定义”,若要修改第4行的局部变量m的名字,则下列选项中不能使用的是( )。
#include
int y;
void f( )
{ int n; double m=1;
printf( );
}
int main()
{ int e=1;f( ); return 0;}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f5-4768-c003-bc7499099f00.html
点击查看题目
21.D22.B23.B24.B25.B26.D27.D28.B29.D30.B
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f4-8418-c003-bc7499099f00.html
点击查看题目
首页
>
文学知识
>
C语言程序设计题库
题目内容
(
单选题
)
手机预览
试题通
C语言程序设计题库

30.下面程序运行后输出结果为________。
#include
int myf( )
{ if(n==1)return m;
else return m+myf(m, n-1);
}
int main()
{ int x=5, y=3; printf( return 0; }

答案:DNMYFXYXY

试题通
分享
试题通
试题通
C语言程序设计题库
相关题目
3.本程序的功能是:验证在7~2000之间的所有素数中存在这样的两个素数,它们的差恰好是1898。
#include
int main()
{ int i,j,a[1000],k=0,m,n,flag=0;
for(i=7;i<2000;i+=2)
{for(j=2;j<=i/2;j++)
if(j%i==0)( (6) );
if(j>i/2)
a[k++]=i;
}
for(i=0;i<k-1;i++)
for(j=1;j<k;j++)
if(( (7) )==1898)
{m=i;n=j;( (8) ); break;}
if( )
printf( );
else
printf( );
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f3-7690-c003-bc7499099f00.html
点击查看答案
1
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f6-8ba0-c003-bc7499099f01.html
点击查看答案
9.若有声明“double x=8, y=5;”,则计算xy的库函数调用形式是( )。
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3ef-f808-c003-bc7499099f02.html
点击查看答案
25.本程序的功能是:将一个字符串(串长不超过50)中连续的空格符值保留一个。例如,若字符串为“I am a student.”,处理后为“I am a student.”。
#include
#include
int main()
{char str[51]; int i;
gets( );
for(i=1; ( (64) ); i++)
if(str[i-1]==' '&&str[i]==' ')
{strcpy(str+i-1,( (65) ));
i--;
}
puts( );
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f4-64d8-c003-bc7499099f00.html
点击查看答案
16.下列程序运行时输出的结果是()。
#include
#include
int fun( )
{int k;
while( )
{k=abs( );
m=( )?n:m;
n=k;
}
return m;
}
int main( )
{printf("%d, %d\n", fun(9, 15), fun(9, 5));
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f5-9588-c003-bc7499099f00.html
点击查看答案
9.下面程序中函数delchar( )的功能是:将字符串s中出现的所有c字符删除。
void delchar( )
{ int j=0, k=0;
while(s[j] != '\0')
{if( )
{s[k] = s[j];
( (24) );
}
( (25) );
}
( (26) );
}
int main()
{ char ch[]="element",c='e';
delchar( );
puts( );
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f6-7818-c003-bc7499099f00.html
点击查看答案
1.( )0( )连续 数组名( )越界
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f4-7478-c003-bc7499099f00.html
点击查看答案
1.scanf() printf()2.%d %f %c 3.逗号 空格 回车符4.%ld
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f0-4240-c003-bc7499099f00.html
点击查看答案
42.下面程序在编译时在第4行报错“error C2082: 形参“m”的重定义”,若要修改第4行的局部变量m的名字,则下列选项中不能使用的是( )。
#include
int y;
void f( )
{ int n; double m=1;
printf( );
}
int main()
{ int e=1;f( ); return 0;}

A.  n

B.  e

C.  f

D.  y

https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f5-4768-c003-bc7499099f00.html
点击查看答案
21.D22.B23.B24.B25.B26.D27.D28.B29.D30.B
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f4-8418-c003-bc7499099f00.html
点击查看答案
试题通小程序
试题通app下载