满意答案
1234567891011121314151617181920212223242526272829303132333435#include<stdio.h>#include<string.h>struct person{ char name[20]; //姓名 char sex; //M:Male男性,F:Female女性 unsigned int age; //年龄}; int main(){ //struct person per1("LiMing","M",20),per2("ZhangLi","F",21); //可以采取上面的方式声明的同时赋值 struct person per1,per2;//声明 //以下为向per1赋值 strcpy(per1.name,"LiMing"); per1.sex='M'; per1.age=20; //以下为向per2赋值 strcpy(per2.name,"ZhouLi"); per2.sex='F'; per2.age=21; //比较大小 if(per1.age
追答:给你看原样复制后编译运行的结果,没问题
00分享举报