26.已有定义语句“char ch1[10]= "12345", ch2[10]= "abcde", ch3[10];”,下面语句中能将ch1中存储的字符串和ch2中存储的字符串正确交换的是( )。
A. ch3=ch1,ch1=ch2, ch2=ch3;
B. ch3[0]=ch1[0],ch1[0]=ch2[0],ch2[0]=ch3[0];
C. strcpy(ch3[0],ch1[0]),strcpy(ch1[0],ch2[0]),strcpy(ch2[0],ch3[0]);
D. strcpy(ch3,ch1), strcpy(ch1, ch2), strcpy(ch2, ch3);
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f2-fd78-c003-bc7499099f00.html
点击查看答案
1.下面叙述正确的是()。
A. C程序在运行时总是从main()函数开始逐条执行语句的
B. main()函数是系统库函数
C. main()函数中每行只能出现一条语句
D. main()函数必须出现在所有其他函数之前
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3ef-34b8-c003-bc7499099f00.html
点击查看答案
35.下面程序运行后输出的结果是()。
#include
int f( )
{ int i, j, m=0, c, k;
for(i=0; i<n; i++)
{ k=a[i]; c=1;
for(j=i+1; j<n; j++)
if( )c++;
else {i=j-1; break; }
if( )i=j;
if(c==1) b[m++]=k;
else {b[m++]=-c; b[m++]=k;}
}
return m;
}
int main()
{ int a[]={5, 5, 5, 5, 5, 5, 5, 5, 5, 5}, b[10], i, j, n=10;
n=f( );
for(i=0; i<n; i++)
{ if(i%2==0) printf( );
printf("%3d", b[i]);}
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f5-f730-c003-bc7499099f00.html
点击查看答案
4.下面程序的功能是:根据下列公式计算cos( )的近似值。精度要求:当通项的绝对值小于等于10
-6时为止。
![](https://yi2.oss-cn-shenzhen.aliyuncs.com/e27f25a49b5047fc8cba4d02f5822d7f.png)
#include
#include<( (10) )>
double mycos( )
{ int n=1;
double s=0, t=1.0;
while (( (11) )>=1e-6)
{s+=t;
t*= ( (12) );
n=n+2;
}
return s;
}
int main()
{ double x;
scanf( );
printf( ;
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f6-4550-c003-bc7499099f00.html
点击查看答案
12.已有定义“int a=2, b=3; float m=4.5, n=3.5;”,则表达式“( )( )/2+( )m%( )n”的值是( )。
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3ef-2518-c003-bc7499099f03.html
点击查看答案
2.输入输出的格式控制字符中,int型数据采用________,float型数据采用________,char型数据采用________。
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3ef-ec50-c003-bc7499099f02.html
点击查看答案
37.以下关于函数形式参数的声明中正确的是________。
A. int a[ ]
B. int a[ ][ ]
C. int a[ ]={0}
D. int a[2][ ]
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f5-33e0-c003-bc7499099f00.html
点击查看答案
29.下面程序运行后输出结果是________。
#include
void fun( )
{ if(n<100)
printf("%d", n/10);
else
{ fun(n/100); printf("%d", n%100/10); }
}
int main()
{ fun(123456); return 0;}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f5-d020-c003-bc7499099f00.html
点击查看答案
16.数学表达式
![](https://yi2.oss-cn-shenzhen.aliyuncs.com/46a0cb20c21a4be9bcfe839cc1aa5b07.png)
所对应的C语言表达式为( )。
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f0-e268-c003-bc7499099f01.html
点击查看答案
1.已有定义“int a=3, b=4, c=5;”,则下列表达式中值为0的是( )。
A. a&&b
B. a<=b
C. a||b&&c
D. !(!c||1)
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f0-e650-c003-bc7499099f00.html
点击查看答案