37.下面程序运行时输出的结果是()。
#include
void fun(int a[3][4])
{ int i, j, k;
for(i=0; i<3; i++)
{ k=0;
for(j=1; j<4; j++)
if( )k=j;
printf("%2d", a[i][k]);
}
}
int main()
{ int a[3][4]={{3, 5, 6, 4}, {5, 2, 4, 3}, {4, 2, 3, 5}};
fun( ); return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f6-02e8-c003-bc7499099f00.html
点击查看答案
58.下面程序段在编译时不会报错的是( )。
A. #define double 2
B. #define b 2
void main()void main()
{double b=0;}{int b=0;}
C. #define b 2
D. #define b 2
void main()int x=b;
{b++;}void main()
{x++;}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3ef-c928-c003-bc7499099f00.html
点击查看答案
12. 下面关于C语言语句的叙述中,正确的是()。
A. 所有语句都包含关键字
B. 所有语句都可以出现在源程序中的任何位置
C. 所有语句都包含表达式
D. 除复合语句外的其他所有语句都以分号结束
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f0-26e8-c003-bc7499099f00.html
点击查看答案
12.下面程序运行时输出结果是()。
#include
int f2( )
{ return m+n; }
int f1( )
{ { static int x=2;
if(y>2){ x=x*x; y=x;}
else y=x+1;
}
return x+y;
}
int main()
{ int a=3;
printf("%2d", f2(a, 2));
printf("%2d", f1(a, 3));
printf("%2d", f1(a, 2));
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f5-85e8-c003-bc7499099f00.html
点击查看答案
11.下面程序是用递归算法求m与n的最大公约数。
设求m与n的最大公约数的函数为gcd( ),则递归公式为:
#include
int gcd( )
{int k;
if(( (30) ))
k=m;
else
k=( (31) );
return k;
}
int main()
{int m,n;
scanf( );
printf(
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f6-87b8-c003-bc7499099f00.html
点击查看答案
3.下面程序的功能是:将输入的正整数按逆序输出,例如:若输入135则输出531,请填空。
#include
int main()
{int n,s;
printf( );
scanf( );
printf( );
do
{s=n%10;
printf( );
( (5) );
}while(( (6) ));
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f2-0b48-c003-bc7499099f00.html
点击查看答案
4.计算下式求出e的值(保留两位小数),要求使用循环嵌套。
#include
int main()
{ int k=1,i,n,t;
float e=1,s=1;
scanf( );
do
{ t=1;
for(i=1;i<=k;i++)
t=t*i;
e=e+1.0/t;
k++;
}while( );
printf("%.2f",e);
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f2-8460-c003-bc7499099f00.html
点击查看答案
4.已有定义“int a[][3]={0, 1, 2, 3, 4, 5, 6};”,则数组a第1维的大小是( )。
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f2-ab70-c003-bc7499099f00.html
点击查看答案
1.声明局部变量时若缺省了存储类型,该变量的存储类型是________。
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f4-d620-c003-bc7499099f00.html
点击查看答案
13.下列四个选项中,属于C语言关键字的是( )。
A. Float
B. single
C. double
D. real
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3ef-0da8-c003-bc7499099f00.html
点击查看答案