#include
#include
#include
using namespace std;
void grading();
struct Node {
int num;
Node *next;
};
Node * listSort(Node *head)
{
Node* p = head;
for(;p!=NULL;p=p->next){
for(Node* j=p->next;j!=NULL;j=j->next){
if(p->num>j->num){
swap(p->num,j->num);
}
}
}
return head;
}
void deleteList(Node *head)
{
Node *tmp;
while (head)
{
tmp = head->next;
delete head;
head = tmp;
}
}
void printList(Node *head)
{
while(head)
{
cout<num<<" ";
head = head->next;
}
cout<num = a[i];
tmp->next = head;
head = tmp;
}
return head;
}
int main()
{
int s[8] = {2,6,4,2,7,9,5,12};
Node * head = createList(s,8);
head = listSort(head);
printList(head);
//忽略阅读
//忽略阅读结束
deleteList(head);
return 0;
}