xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

  • 大小: 4KB
    文件類型: .c
    金幣: 1
    下載: 0 次
    發布日期: 2021-06-09
  • 語言: 其他
  • 標簽: 鏈串??數據結構??

資源簡介

鏈串實現的文本編輯器,封裝了各種操作的方法,如求長度,插入字符等等。

資源截圖

代碼片段和文件信息

#include?“stdio.h“
struct?linkNode{
char?value;
struct?linkNode*?next;
};
struct?linkNode*?createlink();
int?addstr(struct?linkNode*?headNode?char?c);
void?printstr(struct?linkNode*?headNode);
main(){
char?input;
struct?linkNode*?headNode;
headNode=createlink();
do{
input=getch();
if((input>=‘0‘&&input<=‘9‘)||(input>=‘A‘&&input<=‘Z‘)||(input>=‘a‘&&input<=‘z‘)||input==‘?‘){
printf(“%c“input);
addstr(headNodeinput);
}
if(input==‘\b‘){
printf(“\b?\b“);
}
if(input==‘\r‘){
printf(“\r\n“);
addstr(headNodeinput);
}
}while(input!=27)??;
deletestr(headNode“aaa“);
/*?replacestr(headNode“aaa““cccc“);*/
printf(“\n“);
printstr(headNode);
printf(“\nspace?in?the?passage:%d“?countspace(headNode));
printf(“\nchar?in?the?passage:%d“?countchar(headNode));
printf(“\nword?in?the?passage:%d“?countword(headNode));
printf(“\nnumber?in?the?passage:%d“?countnum(headNode));
getch();

}
struct?linkNode*?createlink(){
struct?linkNode*?h;
h=(struct?linkNode*)malloc(sizeof(struct?linkNode));
h->next=NULL????;
h->value=NULL;
return?h;
}

int?addstr(struct?linkNode*?headNodechar?c){
struct?linkNode*?unit;
struct?linkNode*??p;
unit=(struct?linkNode*)malloc(sizeof(struct?linkNode));
unit->next=NULL;
unit->value=c;
p=headNode;
while(p->next!=NULL)p=p->next;?/*move?to?end;*/
p->next=unit;
}

void?printstr(struct?linkNode*?headNode){
struct?linkNode*?p;
char?input;
p=headNode;
while(p->next!=NULL){
p=p->next;
input=p->value;
if((input>=‘0‘&&input<=‘9‘)||(input>=‘A‘&&input<=‘Z‘)||(input>=‘a‘&&input<=‘z‘)||input==‘?‘){
printf(“%c“input);???}
if(input==‘\r‘){
printf(“\r\n“);
}
}
}

int?countspace(struct?linkNode*?headNode){
struct?linkNode*?p;
char?input;
int????count=0;
p=headNode;
while(p->next!=NULL){
p=p->next;
input=p->value;
if(input==‘?‘){
count++;
}
}
return?count;
}

int?countchar(struct?linkNode*?headNode){
struct?linkNode*?p;
char?input;
int????count=0;
p=headNode;
while(p->next!=NULL){
p=p->

評論

共有 條評論