;i++) for(j=i+1;j<L->type;j++) if(L->r[j].sale>L->r[i].sale) {strcpy(num1,L->r[j].num); strcpy(L->r[j].num,L->r[i].num); strcpy(L->r[i].num,num1); strcpy(name1,L->r[j].name); strcpy(L->r[j].name,L->r[i].name); strcpy(L->r[i].name,name1); price1=L->r[j].price; L->r[j].price=L->r[i].price; L->r[i].price=price1; count1=L->r[j].count; L->r[j].count=L->r[i].count; L->r[i].count=count1; sale1=L->r[j].sale; L->r[j].sale=L->r[i].sale; L->r[i].sale=sale1; }printf("\t 按药品销售额排序后:\n"); printf("\t 药品编号药品名称药品单价药品销售量药品销售额\n"); for(i=0;i<L->type;i++) printf("\t %s\t %s\t %f\t %d\t %f\n",L->r[i].num,L->r[i].name,L->r[i].price,L->r[i].count,L->r[i] .sale); }void menu() {printf("\t\t\t 销售记录排序\n"); printf("\t-----------------------------------------------\n"); printf("\t| 1) 按 药品编号|\n"); printf("\t| 2) 按 药品名称