#include#define N 200struct child{ char name[10]; char sex[3]; int age; int height; float weight; struct { int year; int month; int day; }bdate;}ch[N];void input(){ int i; for(i=0;i 多声歌曲
举一反三
- 中国大学MOOC: #include <stdio.h>#define N (sizeof(s)/sizeof(s[0]))struct porb {char *name; int age;} s[]={"LiHua",18,"WangXin",25,"LiuGuo",21};void f(struct porb a[], int n){int i;for (i=0;i<n;i++)printf ("%s:%d\n", a[i].name, a[i].age);}int main(){f(s, N); return 0;}
- 以下结构体的定义语句中,正确的是______。? struct student {int num; char name[10];int age;}stu;|struct {int num; char name[10];int age;}student; struct student stu;|struct student {int num; char name[10]; int age;}; student stu;|struct student {int num; char name[10];int age;};stu;
- 下列有关结构体的定义错误的是_______。 A: typedef date { int year,month,day ;} type_date; B: struct { char name[10] ; float angle ;}; C: typedef struct date { int year,month,day ;} type_date ; D: struct date { int year,month,day ;} type_date ;
- 以下结构体数组定义,不正确的是______。 A: struct date{ int year; int month; int day;}date1[10],date2[10]; B: struct{ int year; int month; int day;}date1[10],date2[10]; C: struct date{ int year; int month; int day;}; ..... struct datedate1[10],date2[10]; D: struct datedate1[10],date2[10];.....struct date{ int year; int month; int day;};
- 下面程序的运行结果是( )。 struct st { int n; int a[20]; }; void f(int *a, int n) { int i; for(i=0;i 2,4,3,9,12,12,11,11,18,18,