91学习

陪伴你每一天!

利用结构体显示学生信息模型

#include <stdio.h>


struct Student{

char cName[20];

char Sex;

int iGrade;

}student1={"hanxue",'w',3};

int main(){

struct Student student2={"wangjiasheng",'M',3};

printf("the student1's information:\n");

printf("Name:%s\n",student1.cName);

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

printf("Grade:%d\n",student1.iGrade);

printf("the student2's information:\n");

printf("Name:%s\n",student2.cName);

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

printf("Grade:%d\n",student2.iGrade);

return 0;

}

加威信18790284560免费送POS机.jpg

发表评论:

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