首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
以下程序中函数fun的功能是:统计person所指结构体数组中所有性别(sex)为M的记录的个数,存入变量n中,并作为函数值返回。请填空: #include<stdio.h> #define N 3 typedef struct {in
以下程序中函数fun的功能是:统计person所指结构体数组中所有性别(sex)为M的记录的个数,存入变量n中,并作为函数值返回。请填空: #include<stdio.h> #define N 3 typedef struct {in
admin
2011-06-10
27
问题
以下程序中函数fun的功能是:统计person所指结构体数组中所有性别(sex)为M的记录的个数,存入变量n中,并作为函数值返回。请填空:
#include<stdio.h>
#define N 3
typedef struct
{int mum,char name[10];char sex;}SS;
int fun(SS person[])
{int i,n=0;
for(i=0;i<N;i++)
if(( )==’M’)n++;
return n;
}
main()
{SS W[N]={{1,’AA’,’F’},{2,’BB’,’M’},{3,’CC’,’M’}};int n;
n=fun(W);printf("n=%d\n",n);
}
选项
答案
person[i].scx
解析
转载请注明原文地址:https://kaotiyun.com/show/83Pp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
有以下程序 main() { inta=666,b=888; printf("%d\n",a,b); } 程序运行后的输出结果是
有以下程序 main() {intm=3,n=4,x; x=-m++; x=x+8/++n; printf("%d\n",x); } 程序运行后的输出结果是
下列说法不正确的是()。
下列语句的输出结果是______。chars[20]="aaaa",*sp=s;puts(strcat(sp,"AAAAA"));
设x、y、z均为int型变量,请写出描述“x或y中至少有一个小于z”的表达式______。
已有定义:.chara[]="xyz",b[]={’x’,’y’,’z’);,以下叙述中正确的是
设在主函数中有以下定义和函数调用语句,且fun函数为void类型;请写出fun函数的首部【】。要求形参名为b。main(){double[10][22];intn;......fun(s);}
下列不属于软件工程的3个要素的是()。
若采用直接插入法对字母序列(W,S,E,L,X,G,I)进行排序,使字母按升序排列,那么第一次排序的结果为【】。
在下面关于指针的说法中,错误的一条是()
随机试题
试述膝关节动脉网的构成及临床意义?
傅雷的性格,最突出的是他的刚直。在青年时候,他的刚直还近于狂妄。所以孔子说:“好刚不好学,其蔽也狂。”傅雷从昆明回来以后,在艺术的涵养,知识学问的累积之后,他才成为具有浩然之气的儒家之刚者,这种刚直的品德,在任何社会中,都是难得见到的,连孔子也说过:“吾未
食管静脉曲张时,食管吞钡X线检查表现为:食管轮廓呈________,曲张静脉呈________。
男性,23岁,因胸4椎体单纯压缩骨折卧床休息。骨折后早期胸腰部的功能锻炼方法是
下面哪一句话是错误的
A.凉血止血B.收敛止血C.化瘀止血D.温经止血E.清热止血白及具有的功效是
A.迟发性毒性作用B.过敏性反应C.高敏感性D.速发性毒性作用E.特异体质反应某患者因肺炎就医,经皮试注射青霉素后出现全身荨麻疹,属于
设计市场风险限额体系时应综合考虑的因素包括()。Ⅰ.自身业务性质,规模和复杂程度Ⅱ.内部控制水平Ⅲ.压力测试结果Ⅳ.能够承担的市场风险水平
五年级一班上学期女生人数占全班人数的,下学期开学初又转来5名女生,这时女生人数占全班人数的,上学期末,五年级一班共有多少名学生?()
Thefilmisanawardwinnerandis______.
最新回复
(
0
)