输入一串数,然后,建立链表,排序输出
#includetypedefstructNode{intdata;structNode*next;}linknode,*linklist;linklistCreate(linklistL){inta;linknode*p,*q,*k;L=(structlinknode*)malloc(sizeof(linknode));L->next=NULL;p=L;scanf("%d",&a);while(a
=0){q=(structlinknode*)malloc(sizeof(linknode));q->next=NULL;q->data=a;if(L->next
=NULL){k=L;p=L->next;if(p->data>a){k->next=q;q->next=p;}else{while(p->datanext
=NULL){k=p;p=p->next;}if(p->next==NULL&&p->datanext=q;else{k->next=q;q->next=p;}}}elsep->next=q;scanf("%d",&a);}returnL;}voidPrint(linklistL){linknode*p;p=L->next;if(p==NULL)return;while(p
=NULL){printf("%d",p->data);p=p->next;}}voidInsert(linklistL){}main(){linklistL;L=Create(L);Print(L);}2
计算26个字母的输入次数,好像不区分大小写
#include#includemain(){charf[200];inti,b,k,s[200];scanf("%s",f);b=strlen(f)-1;for(k=65;k