APP下载
首页
>
财会金融
>
c语言冲就完事了家人们
搜索
c语言冲就完事了家人们
题目内容
(
单选题
)
14.执行以下程序段后,输出的结果是______。
int i,j;
for(i=1;i<=3;i++)
{
for(j=1;j<=5;j++)
if(j%2==0) break;
printf( );
}

A、  1 1 1

B、  2 2 2

C、  1 3 5

D、  2 4 6

答案:B

c语言冲就完事了家人们
18.下列函数值的类型是______。
fun( )
{
int y;
y=3*x-1;
return y;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-43a8-c044-ce3414c8e902.html
点击查看题目
8.若变量c为char类型,以下不能正确判断其为大写字母的表达式是______。
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fa-d648-c044-ce3414c8e901.html
点击查看题目
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
点击查看题目
89,85,83,83,70,79,81,62,76,79,66,85,89,89,72};
/*考生在此行下设计程序,不得删除本行*/
int sum=0,i;
double aver;
for( )
sum+=a[i];
aver=1.0*sum/30;
printf( );
}
第三套
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-7670-c044-ce3414c8e900.html
点击查看题目
8.设有int a=3,b=4;,以下不合法的C语言语句是______。
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-3408-c044-ce3414c8e900.html
点击查看题目
24.设有:
typedef struct ST
{
long a;
int b;
char c[2];
}NEW;
则下面叙述中正确的是_______。
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-fb40-c044-ce3414c8e901.html
点击查看题目
3.以下选项中,不能作为C语言合法标识符的是______。
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fa-ce78-c044-ce3414c8e900.html
点击查看题目
5.设有int m=15,n;,则执行语句n=++m;后m、n的值分别为______。
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-d430-c044-ce3414c8e901.html
点击查看题目
5.设有定义:int x=2;,以下表达式中,值不为6的是______。
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fc-2a20-c044-ce3414c8e900.html
点击查看题目
8.下面选项中能正确表示“|x|≤21”的C语言表达式是______。
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-dc00-c044-ce3414c8e900.html
点击查看题目
首页
>
财会金融
>
c语言冲就完事了家人们
题目内容
(
单选题
)
手机预览
c语言冲就完事了家人们

14.执行以下程序段后,输出的结果是______。
int i,j;
for(i=1;i<=3;i++)
{
for(j=1;j<=5;j++)
if(j%2==0) break;
printf( );
}

A、  1 1 1

B、  2 2 2

C、  1 3 5

D、  2 4 6

答案:B

c语言冲就完事了家人们
相关题目
18.下列函数值的类型是______。
fun( )
{
int y;
y=3*x-1;
return y;
}

A.   int

B.   float

C.   void

D.   double

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-43a8-c044-ce3414c8e902.html
点击查看答案
8.若变量c为char类型,以下不能正确判断其为大写字母的表达式是______。

A.   'A'<=c<='Z'

B.   c>='A'&&c<='Z'

C.   (c+32)>= 'a'&&(c+32)<= 'z'

D.   !(c<'A'||c>'Z')

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fa-d648-c044-ce3414c8e901.html
点击查看答案
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
点击查看答案
89,85,83,83,70,79,81,62,76,79,66,85,89,89,72};
/*考生在此行下设计程序,不得删除本行*/
int sum=0,i;
double aver;
for( )
sum+=a[i];
aver=1.0*sum/30;
printf( );
}
第三套
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-7670-c044-ce3414c8e900.html
点击查看答案
8.设有int a=3,b=4;,以下不合法的C语言语句是______。

A.   a=b==4;

B.   a=b%3.5;

C.   a=b=4;

D.   a+=a+3;

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-3408-c044-ce3414c8e900.html
点击查看答案
24.设有:
typedef struct ST
{
long a;
int b;
char c[2];
}NEW;
则下面叙述中正确的是_______。

A.   ST是一个结构体类型变量

B.   NEW是一个结构体类型

C.   NEW是一个结构体变量

D.   以上的说明形式非法

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-fb40-c044-ce3414c8e901.html
点击查看答案
3.以下选项中,不能作为C语言合法标识符的是______。

A.   Myscore2

B.   Myscore2

C.   Myscore-2

D.   Myscore_2

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fa-ce78-c044-ce3414c8e900.html
点击查看答案
5.设有int m=15,n;,则执行语句n=++m;后m、n的值分别为______。

A.   15,15

B.   15,16

C.   16,15

D.   16,16

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-d430-c044-ce3414c8e901.html
点击查看答案
5.设有定义:int x=2;,以下表达式中,值不为6的是______。

A.   x*=x+1

B.   x++,2*x

C.   x*=(1+x)

D.   2*x,x+=2

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fc-2a20-c044-ce3414c8e900.html
点击查看答案
8.下面选项中能正确表示“|x|≤21”的C语言表达式是______。

A.   -21≤x≤21

B.   -21<=x&&x<=21

C.   -21<=x||x<=21

D.   -21<=x<=21

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