一种简单的英文词典排版系统的实现报告Word文档格式.docx
- 文档编号:13523565
- 上传时间:2022-10-11
- 格式:DOCX
- 页数:12
- 大小:64.74KB
一种简单的英文词典排版系统的实现报告Word文档格式.docx
《一种简单的英文词典排版系统的实现报告Word文档格式.docx》由会员分享,可在线阅读,更多相关《一种简单的英文词典排版系统的实现报告Word文档格式.docx(12页珍藏版)》请在冰豆网上搜索。
FILE*p;
/*清屏*/
voidclear()
{
system("
cls"
);
}
/*写入文件*/
voidWrite(intr)
inti;
p=fopen("
Data.txt"
"
w"
);
for(i=0;
i<
r;
i++)
{
fprintf(p,"
%s\n"
dic[i]);
}
fclose(p);
/*读取文件*/
intRead()
intr=0;
r"
while(fscanf(p,"
%s"
dic[r])!
=EOF)
r++;
Write(r);
returnr;
/*主菜单*/
voidPrint()
printf("
\n\n"
********************************************************\n"
*way=1:
appendwords*\n"
*way=2:
lookupwords*\n"
printf("
*way=3:
endwork*\n"
*way=4:
cheak*\n"
pleasechooseaway="
/*字符排序*/
intsort()
inti,j,flag=1,r;
chars[20];
r=Read();
for(i=1;
r&
&
flag==1;
flag=0;
for(j=0;
j<
r-i;
j++)
if(strcmp(dic[j],dic[j+1])>
0)
flag=1;
strcpy(s,dic[j]);
strcpy(dic[j],dic[j+1]);
strcpy(dic[j+1],s);
Write(r);
return0;
/*检查模块*/
voidCheak()
clear();
%s"
dic[r]);
if(r==0)printf("
thereisnowordinData.txt\n"
else
\n\nthereare%dwordsinData.txt!
\n"
r);
}
voidInsert(char*d)
charf[20];
intr=Read();
intflag=0;
if(strcmp(d,dic[i])==0)
theword%shasalreadyexisted\n"
d);
break;
if(flag==0)
theword%sissuccessfullyadded\n"
d);
strcpy(dic[r],d);
\n\ncontinueadding,pleaseinputaword;
backtomainmenu,input0:
while(scanf("
f)&
!
(f[0]=='
0'
&
f[1]==0))
if(strcmp(f,dic[i])==0)
f);
strcpy(dic[r],f);
sort();
return;
/*查找已录入单词*/
voidFind(char*s)
chart[20];
intr=0,c,i;
inttemp;
t)!
strcpy(dic[r],t);
temp=strcmp(s,t);
if(temp==0)
c=r;
if(flag)
%s'
ssequencenumberis%d!
s,c);
else
cannotfind%s!
s);
\n\ncontinuelookuping,pleaseinputaword;
c=i+1;
f,c);
/*菜单选择模块*/
voidWork()
inti,way;
chard[20];
while
(1)
Print();
scanf("
%d"
&
way);
switch(way)
case1:
pleaseinputaword:
"
Insert(d);
case2:
Find(d);
case3:
allthewordsaresavedinData.txt!
"
case4:
Cheak();
/*主函数*/
voidmain()
Work();
二、运行结果:
(1)主菜单
(2)添加单词界面
(3)检查输入的单词
六、总结:
通过这次C语言课程设计,我学会了很多东西,复习了以前学过的东西,加深了对C语的认识。
刚开始接到题目时,我一筹莫展,觉得题目很难。
但经过和同学、老师的探讨和交流,我对这问题有了了解,慢慢的开始编程。
通过这次实习,我认识到做事必须要实践才行,经过交流才会慢慢化解题目,C语言必须要多练习才能学得好,所以我以后要坚持多练习,努力通过计算机等级考试
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 一种 简单 英文 词典 排版系统 实现 报告
![提示](https://static.bdocx.com/images/bang_tan.gif)