以下程序中函数fun的功能是:统计person所指结构体数组中所有性别(sex)为'M'的记录个数,存入变量n中,并作为函数值返回。请填空。
#include
#define N 3
typedef struct
{ int num;
char nam[10];
char sex;
}SS;
int fun(SS person[])
{ int i, n=0;
for(i=0; i if( =='M')
n++;
return n;
}
#include
#define N 3
typedef struct
{ int num;
char nam[10];
char sex;
}SS;
int fun(SS person[])
{ int i, n=0;
for(i=0; i
n++;
return n;
}