今天为大家演示自定义函数
#includestring.h struct student { char a[10]; char b[3]; int c; }; main() { struct student stu; struct student stu1; struct student stu2; strcpy(stu.a,樱满集); strcpy(stu.b,男); stu.c=15; strcpy(stu1.a,少司命); strcpy(stu1.b,女); stu1.c=16; strcpy(stu2.a,初音未来); strcpy(stu2.b,女); stu2.c=14; if(stu.c>stu1.c) { puts(stu.a); puts(stu.b); printf(%d,stu.c); } else if(stu1.c>stu2.c) { puts(stu1.a); puts(stu1.b); printf(%d,stu1.c); } else { puts(stu2.a); puts(stu2.b); printf(%d,stu2.c); }