#include <stdio.h> int main(){ struct student{ int num; char name[50]; float score; }stu1,stu2,stu3; stu1.num=1; strcpy(stu1.name,"Jihong Liu"); stu1.score=100; stu2.num=2; strcpy(stu2.name,"Wei Liu"); stu2.score=67; struct student stu3={3,"San Zhang",80}; printf("stu1:\nname:%s;num:%d;score:%.1f\n",stu1.name,stu1.num,stu1.score); printf("stu2:\nname:%s;num:%d;score:%.1f\n",stu2.name,stu2.num,stu2.score); printf("stu3:\nname:%s;num:%d;score:%.1f\n",stu3.name,stu3.num,stu3.score); return 0; }
慕莱坞8333017
Yexiaomo
望远
相关分类