移动指针进行冒泡排序,但是指针好像有点不为所动...
c语言吧
全部回复
仅看楼主
level 2
阿利哈姆 楼主
typedef struct Student
{
int num; //学生的学号
char name[20]; //学生的姓名
char Class[20]; //学生的班级
int titleno; //题目号
char title[30]; //题目内容
int titleselect;//选题状态
struct Student *next;//下一个节点的指针
}STUDENT, *PSTUDENT;
PSTUDENT p,q,r,fir;
for(fir=&g_head,p=&g_head,q=p->next;q!=NULL; p=fir)
{
for(p=p->next,q=p->next; q != NULL; q = q->next)
{
while((p->num) > (q->num))
{
r=q;
q=p;
p=r;
q=q->next;
}
}
fir=fir->next;
}
2018年12月07日 04点12分 1
level 2
阿利哈姆 楼主
自顶
2018年12月07日 04点12分 2
1