APP下载
首页
>
财会金融
>
c语言冲就完事了家人们
搜索
c语言冲就完事了家人们
题目内容
(
单选题
)
1.以下叙述正确的是_______。

A、  在C程序中,main函数必须位于程序的最前面

B、  C语言本身没有输入输出语句

C、  C语言的每一行中只能写一条语句

D、  在对一个C语言程序进行编译的过程中,可发现注释中的拼写错误

答案:B

c语言冲就完事了家人们
25.执行以下程序后,输出的结果是______。
#include
void main()
{
int a=2,b=3;
a=a^b;
b=a^b;
a=a^b;
printf( );
}
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fa-f970-c044-ce3414c8e900.html
点击查看题目
16.以下对二维数组b的定义,正确的是______。
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-9998-c044-ce3414c8e900.html
点击查看题目
25.已知:int a=24;,则“a>>3”的值是______。
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fc-a720-c044-ce3414c8e900.html
点击查看题目
17.字符串"A"和字符常量'A'各占用______个字节的内存空间。
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-ef88-c044-ce3414c8e900.html
点击查看题目
11.设有int x=1,y=2,z;,则表达式z=x>y?x+y:x-y值为______。
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-8de0-c044-ce3414c8e900.html
点击查看题目
11.执行以下程序段后,输出的结果是______。
int x=2,y=0;
switch( )
{
case 2: x++;y=x+1;
case 1: y=y+1;break;
default:x++;y=y+1;
}
printf( );
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fa-da30-c044-ce3414c8e902.html
点击查看题目
25.已知int a=4,b=a<<2;,则语句printf( );的输出结果是______。
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-ff28-c044-ce3414c8e900.html
点击查看题目
1.计算机能直接执行的程序是_______。
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fc-2250-c044-ce3414c8e900.html
点击查看题目
17.设有char s[2][10]={"12","34"};,则数组s占用______个字节。
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-43a8-c044-ce3414c8e901.html
点击查看题目
9.设有以下语句:char c1,c2;scanf("%c%c",&c1,&c2);,若要为变量c1和c2分别输入字符A和B,正确的输入形式应该是______。
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-89f8-c044-ce3414c8e900.html
点击查看题目
首页
>
财会金融
>
c语言冲就完事了家人们
题目内容
(
单选题
)
手机预览
c语言冲就完事了家人们

1.以下叙述正确的是_______。

A、  在C程序中,main函数必须位于程序的最前面

B、  C语言本身没有输入输出语句

C、  C语言的每一行中只能写一条语句

D、  在对一个C语言程序进行编译的过程中,可发现注释中的拼写错误

答案:B

c语言冲就完事了家人们
相关题目
25.执行以下程序后,输出的结果是______。
#include
void main()
{
int a=2,b=3;
a=a^b;
b=a^b;
a=a^b;
printf( );
}

A.   2,2

B.   2,3

C.   3,2

D.   3,3

解析:说明:(1) 要求使用循环实现;(2)输出结果保留5位小数,形式为:
PI=3.12345
#include
void main()
{
/*考生在此行下设计程序,不得删除本行*/


}
#include
void main()
{
/*考生在此行下设计程序,不得删除本行*/
double s=0;
long n,i;
int t=1;
printf("Enter n:");
scanf("%ld",&n);
for (i=1;i<=n;i++)
{
s+=t*1.0/(2*i-1);
t=-1*t;
}
printf("PI=%.5lf\n",4*s);
}
综合应用题3:快递小哥张师傅4月份的每天送件单数和行车里程(公里)分别保存在数组a和b中,其中数组元素-1表示该天休息,没有出工。
计算并输出4月份张师傅出工日每天平均送件单数和平均行车里程(要求使用循环实现,结果保留2位小数)。
输出格式为:
平均每天送件单数:123.45,平均每天行车里程:131.98 公里
参考程序:
#include
void main()
{
/*每天送件单数*/
int a[30]={-1,91,127,113,155,164,153,122,-1,-1,143,129,148,157,179,151,-1,167,185,188,192,184,137,-1,161,178,157,158,147,-1};
/*每天行车里程(公里)*/
int b[30]={-1,88,151,109,155,139,146,131,-1,-1,136,175,165,147,196,160,-1,146,128,135,153,178,141,-1,131,149,155,178,216,-1};
/*考生在此行下设计程序,不得删除本行*/
int i,n=0;
float count=0,dist=0;
for(i=0;i<30;i++)
{
if(a[i]!=-1)
{
count=count+a[i];
dist=dist+b[i];
n++;
}
}
printf("平均每天送件单数:%.2f,平均每天行车里程:%.2f 公里\n",count/n,dist/n);
}
第二套

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fa-f970-c044-ce3414c8e900.html
点击查看答案
16.以下对二维数组b的定义,正确的是______。

A.   int b[3..4];

B.   int b(3,4);

C.   int b[3][4];

D.   int b(3..4);

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-9998-c044-ce3414c8e900.html
点击查看答案
25.已知:int a=24;,则“a>>3”的值是______。

A.   72

B.   4

C.   3

D.   0

解析:说明:(1) 要求使用循环实现;(2)输出结果形式为:
n=12345
参考程序一:
#include
void main()
{
/*考生在此行下设计程序,不得删除本行*/
int n,i;
n=0;
for(i=520;i<=2021314;i++)
if(i%3==0&&i%10==7) n++;
printf("n=%d\n",n);
}
综合应用题3:某班级有30名同学,C语言课程的平时成绩和期末成绩分别存储在数组a和b中,请计算总评成绩,并存储在数组c中。
总评成绩=平时成绩*30%+期末成绩*70%
统计并输出总评成绩及格(≥60)人数和不及格(<60)人数。
参考程序:
#include
void main()
{
/*平时成绩*/
int a[30]={78,79,76,83,87,83,89,94,65,34,65,78,64,84,67,22,95,93,86,85,87,88,98,95,73,82,87,56,87,23};
/*期末成绩*/
int b[30]={65,86,26,65,75,78,56,84,85,61,74,69,33,78,76,63,88,95,82,89,97,78,66,83,85,72,91,54,78,70};
double c[30];
/*考生在此行下设计程序,不得删除本行*/
int i,pass=0,nopass=0;
for(i=0;i<30;i++)
{
c[i]=a[i]*0.3+b[i]*0.7;
if(c[i]>=60) pass++;
else nopass++;
}
printf("总评成绩及格%d人,不及格%d人\n",pass,nopass);
}

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fc-a720-c044-ce3414c8e900.html
点击查看答案
17.字符串"A"和字符常量'A'各占用______个字节的内存空间。

A.   1,1

B.   1,2

C.   2,1

D.   2,2

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-ef88-c044-ce3414c8e900.html
点击查看答案
11.设有int x=1,y=2,z;,则表达式z=x>y?x+y:x-y值为______。

A.   1

B.   2

C.   3

D.   -1

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-8de0-c044-ce3414c8e900.html
点击查看答案
11.执行以下程序段后,输出的结果是______。
int x=2,y=0;
switch( )
{
case 2: x++;y=x+1;
case 1: y=y+1;break;
default:x++;y=y+1;
}
printf( );

A.   3,5

B.   3,4

C.   2,0

D.   3,1

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fa-da30-c044-ce3414c8e902.html
点击查看答案
25.已知int a=4,b=a<<2;,则语句printf( );的输出结果是______。

A.   2

B.   4

C.   8

D.   16

解析:说明:上月存款余额不计入本月收入。
参考程序:
#include
void main()
{
double a[]={-345.68,-456.23,-220,3180.85,-261.5,-252.36,-266.45,-231.23,-112.06,-516.05,3230,-231,-129.4,-198.7,-168,-502.57,-508,-136,-143,-147,-117,982,-188,-195.58,-102.4,-132.45,-545,0};
/*考生在此行下设计程序,不得删除本行*/
double total=6858,sum1=0,sum2=0;
int i;
for(i=0;a[i]!=0;i++)
{
total+=a[i];
if(a[i]>0)sum1+=a[i];
if(a[i]<0)sum2+=a[i];
}
printf("本月收入总额=%.2lf元\n",sum1);
printf("本月支出总额=%.2lf元\n",sum2);
printf("银行账户存款余额=%.2lf元\n",total);
}
第五套

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-ff28-c044-ce3414c8e900.html
点击查看答案
1.计算机能直接执行的程序是_______。

A.   可执行程序

B.   目标程序

C.   源程序

D.   汇编程序

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fc-2250-c044-ce3414c8e900.html
点击查看答案
17.设有char s[2][10]={"12","34"};,则数组s占用______个字节。

A.   2

B.   10

C.   20

D.   4

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-43a8-c044-ce3414c8e901.html
点击查看答案
9.设有以下语句:char c1,c2;scanf("%c%c",&c1,&c2);,若要为变量c1和c2分别输入字符A和B,正确的输入形式应该是______。

A.   A和B之间用逗号分隔

B.   A和B之间不能有任何分隔符

C.   A和B之间可以用回车分隔

D.   A和B之间用空格分隔

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-89f8-c044-ce3414c8e900.html
点击查看答案
试题通小程序
试题通app下载