- 综合讨论区
- 帖子详情
是
物联网205202017170542杨镇阳
发表于2020年12月29日
<p>#include <stdio.h></p><p>struct Date{</p><p> int year;</p><p> int month;</p><p> int day;</p><p>};</p><p>struct Student{</p><p> int num;</p><p> char name[10];</p><p> char id[19];</p><p> Date birthday;</p><p> char sex;</p><p> int age;</p><p> double score[5];</p><p> char addr[30];</p><p> char tel[12];</p><p> char email[30];</p><p>};</p><p>void display( struct Student *s){</p><p> printf(" 学生详细信息\n");</p><p> printf("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&\n");</p><p> printf("学号:%d\n",s->num);</p><p> printf("姓名:%s\n",s->name);</p><p> printf("id号:%s\n",s->id);</p><p> printf("生日:%d-%d-%d\n",s->birthday.year,s->birthday.month,s->birthday.day);</p><p> printf("性别:%c\n",s->sex);</p><p> printf("年龄:%d\n",s->age);</p><p> printf("住址:%s\n",s->addr);</p><p> printf("电话:%s\n",s->tel);</p><p> printf("邮箱:%s\n",s->email);</p><p> printf("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&\n");</p><p>}</p><p>int main(){</p><p> struct Student s={</p><p><br ></p><p> struct Student s1;</p><p> s1=s;</p><p> s1.age=18;</p><p> display(&s1); </p><p>}</p><p><br ></p>