结构体怎么输出对应的值
程序代码:
#include<stdio.h> #include <string.h> struct student { char num[20]; char name[20]; }; void main() { struct student stu[20]={ {"201060001","Zhao"}, {"201060002","Qian"}, {"201060009","Jiang"}, {"201060003","Sun"}, {"201060005","Wang"}, {"201060006","Zhou"}, {"201060004","Li"}, {"201060008","Zhen"}, {"201060007","Wu"}, {"201060010","Shen"}}; char a[20][300],temp[300]; int i,j; for(i=0;i<10;i++) for(j=i+1;j<10;j++) { if(strcmp(stu[i].num,stu[j].num)>0) { strcpy(temp,stu[i].num); strcpy(stu[i].num,stu[j].num); strcpy(stu[j].num,temp); } } printf("*******************************\n"); printf("Results:\n\n"); for(i=0;i<10;i++) { puts(stu[i].num); printf("\n"); } }请问怎么将对应的姓名输出来啊?