91学习

陪伴你每一天!

结构体中含有结构体输出学生基本信息

#include <stdio.h>


struct date{

int year;

int month;

int day;

};

struct student{

char name[30];

int num;

char sex;

struct date birthday;

}student={"suYuQun",12052212,'w',{1986,12,6}};

int main(){

printf("-----Information-----\n");

printf("Name:%s\n",student.name);

printf("Number:%d\n",student.num);

printf("Sex:%c\n",student.sex);

printf("Birthday:%d,%d,%d\n",student.birthday.year,student.birthday.month,student.birthday.day);

return 0;

}

加威信18790284560免费送POS机.jpg

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。