C语言版数据结构课程设计-文章编辑系统Word文档下载推荐.doc
- 文档编号:13031998
- 上传时间:2022-10-03
- 格式:DOC
- 页数:16
- 大小:205.50KB
C语言版数据结构课程设计-文章编辑系统Word文档下载推荐.doc
《C语言版数据结构课程设计-文章编辑系统Word文档下载推荐.doc》由会员分享,可在线阅读,更多相关《C语言版数据结构课程设计-文章编辑系统Word文档下载推荐.doc(16页珍藏版)》请在冰豆网上搜索。
*p=head,count=0
intlen=strlen(p->
data)
i=0
i<
len
p->
data[i]>
=48&
&
data[i]<
=57
count++
i++
p=p->
next
!
p=NULL
结束
N
Y
课程设计说明书NO.3
intFindString(LINE*&
head,char*str)/*统计str在文章中出现的次数*/
count=0;
h=0;
len1=0;
len2=strlen(str);
data[i]==str[0]
k=0;
j=0;
data[i+j]==str[j]
k++;
j++;
k=len2
count++;
i=i+k-1;
图3:
统计str在文章中的出现次数
课程设计说明书NO.4
2.2源程序清单
#include<
string.h>
stdio.h>
typedefstructline
{
char*data;
structline*next;
}LINE;
voidCreate(LINE*&
head)
LINE*p;
printf("
请输入一页文章,以#为结尾(每行最多输入80字符!
):
\n"
);
p=(structline*)malloc(sizeof(structline));
head=p;
chartmp[200];
for(;
1;
)
{
gets(tmp);
if(strlen(tmp)>
80)
{
printf("
每行最多输入80字符"
break;
}
if(tmp[0]==35)break;
p=p->
next=(structline*)malloc(sizeof(structline));
p->
data=(char*)malloc(strlen(tmp));
strcpy(p->
data,tmp);
if(tmp[strlen(tmp)-1]==35)
{
p->
data[strlen(tmp)-1]='
\0'
;
课程设计说明书NO.5
break;
}
p->
next=NULL;
head=head->
next;
}
intCountLetter(LINE*&
{
LINE*p=head;
intcount=0;
do
{
intLen=strlen(p->
data);
for(inti=0;
Len;
i++)
if((p->
='
a'
z'
)||(p->
A'
Z'
))
}
while((p=p->
next)!
=NULL);
returncount;
head)
LINE*p=head;
intcount=0;
do
{
if(p->
p->
=57)count++;
课程设计说明书NO.6
while((p=p->
returncount;
intCountSpace(LINE*&
data[i]==32)count++;
returncount;
/*统计文章的总字数*/
intCountAll(LINE*&
do
{
count+=strlen(p->
}
while((p=p->
课程设计说明书NO.7
head,char*str)
inth=0;
intlen1=0;
intlen2=strlen(str);
inti,j,k;
do
len1=strlen(p->
for(i=0;
len1;
i++)
{
if(p->
data[i]==str[0])
{
k=0;
for(j=0;
j<
len2;
j++)
if(p->
data[i+j]==str[j])k++;
if(k==len2) {count++;
}
}
voiddelstringword(char*s,char*str)
char*p=strstr(s,str);
课程设计说明书NO.8
chartmp[80];
intlen=strlen(s);
inti=len-strlen(p);
intj=i+strlen(str);
for(intm=0;
m<
i;
m++)tmp[count++]=s[m];
for(intn=j;
n<
len;
n++)tmp[count++]=s[n];
tmp[count]='
strcpy(s,tmp);
}
voidDelString(LINE*&
if(strstr(p->
data,str)!
=NULL)delstringword(p->
data,str);
}
while((p=p->
voidOutPut(LINE*&
{
printf("
%s\n"
p->
while((p=p->
沈
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 语言版 数据结构 课程设计 文章 编辑 系统