4.算法应具备如下几个特征:确定性、有穷性、可行性和________。
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3ee-ee68-c003-bc7499099f03.html
点击查看答案
4.下面程序运行后输出的结果是________。
#include
int main()
{ int f,f1,f2,i;
f1=1;f2=1;
printf("%2d %2d",f1,f2) ;
for(i=3;i<=5;i++)
{ f=f1+f2;
printf("%2d",f);
f1=f2; f2=f;
}
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f1-c4f8-c003-bc7499099f00.html
点击查看答案
16.下面语句中有语法错误的是( )。
A. printf("%d", 0e);
B. printf("%f", 0e2);
C. printf("%d", 0x2);
D. printf("%s", "0x2");
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f0-32a0-c003-bc7499099f00.html
点击查看答案
19.已有定义“int a[3][2]={1, 2, 3, 4, 5, 6};”,数组元素________的值为6。
A. a[3][2]
B. a[2][1]
C. a[1][2]
D. a[2][3]
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f2-e220-c003-bc7499099f00.html
点击查看答案
22.本程序的功能是:判断一个数组中各元素之间的逻辑关系。若所有元素的值均相等则输出“all elements are same”;若所有元素的值无序则输出“no order”;若所有元素的值按升序排列则输出“ascend”;若所有元素的值按降序排列则输出“descend”。
#include
void judge( )
{ int flag, i=0;
while(i<n-1&&( (57) )) i++;
if(i==n-1)
{ printf( );
return; }
if(a[i]<a[i+1])flag=1;
else flag=0;
for(; i<n-1; i++)
if(flag&&a[i]>a[i+1]||!flag&&( (58) ))
{ printf( );
return; }
if(( (59) )) printf( );
else printf( );
}
int main( )
{ int a[5]={1, 2, 3, 4, 5}, b[5]={5, 4, 3, 2, 1}, c[5]={1, 4, 2, 3, 5}, d[5]={2, 2, 2, 2, 2};
judge(a, 5);
judge(b, 5);
judge(c, 5);
judge(d, 5);
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f7-0c88-c003-bc7499099f00.html
点击查看答案
7. C语言中共有________个关键字。
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3ee-f250-c003-bc7499099f02.html
点击查看答案
43.已有定义“char c='1'; int x=300; float w=35000; double d=3.1234567e10;”,则下面表达式求值时除( )外其结果都可能是不准确的。
A. x=w/c
B. w=d/x
C. w=d/1e5f
D. w=x+c
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3ef-a600-c003-bc7499099f00.html
点击查看答案
16.对于C语言函数,下列叙述中正确的是()。
A. 函数的定义不能嵌套,但函数调用可以嵌套
B. 函数的定义可以嵌套,但函数调用不能嵌套
C. 函数的定义和调用都不能嵌套
D. 函数的定义和调用都可以嵌套
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f5-08e8-c003-bc7499099f00.html
点击查看答案
5.计算表达式
![](https://yi2.oss-cn-shenzhen.aliyuncs.com/19fea4523c434e9f9c57020712d7a82d.png)
x>1
要求计算精度为第n项的绝对值小于10
– 5。
#include
int main()
{ float y,s=1,x,xx=1,a=1,i=1;
scanf( );
do
{ a=-a;
i++;
xx=xx*x;
y=i/xx;
s=s+a*y;
}while(y>0.00001);
printf( );
return 0;
}
第6章 数组
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f2-8c30-c003-bc7499099f00.html
点击查看答案
9.下面叙述中正确的是( )。
A. break语句只能用于switch语句体中
B. continue语句的作用是:使程序的执行流程跳出包含它的所有循环
C. break语句只能用在循环体内和switch语句体内
D. 在循环体内使用break语句和continue语句的作用相同
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f1-a5b8-c003-bc7499099f00.html
点击查看答案