#include #include struct number { int num; struct number *next; }; void main() { struct number *head; struct number *p1,*p2,*p,*p3,*p4; int n=0,m,i,j; p1=p2=(struct number *)malloc(sizeof(struct number)); printf("\nWang jianfei 060806110006\n\n\n"); printf("Please enter the number: \n"); scanf("%d",&p1->num); head=NULL; while(p1->num!=NULL) { n=n+1; if(head==NULL) head=p1; else p2->next=p1; p2=p1; p1=(struct number *)malloc(sizeof(struct number)); scanf("%d",&p1->num); } p2->next=NULL; p=head; for(p4=head;p4!=NULL;p4=p4->next) { for(p3=head;p3->next!=NULL;p3=p3->next) { if(p4->num>p3->num) { m=p4->num; p4->num=p3->num; p3->num=m; } } p=head; } printf("\nNow,there %d numbers are: ",n); p=head; printf("\n"); if(head!=NULL) do { printf("%5d ",p->num); p=p->next; }while(p!=NULL); printf("\n"); getch(); }