一种简单的英文词典排版系统的实现报告Word文档格式.docx

上传人:b****1 文档编号:13523565 上传时间:2022-10-11 格式:DOCX 页数:12 大小:64.74KB
下载 相关 举报
一种简单的英文词典排版系统的实现报告Word文档格式.docx_第1页
第1页 / 共12页
一种简单的英文词典排版系统的实现报告Word文档格式.docx_第2页
第2页 / 共12页
一种简单的英文词典排版系统的实现报告Word文档格式.docx_第3页
第3页 / 共12页
一种简单的英文词典排版系统的实现报告Word文档格式.docx_第4页
第4页 / 共12页
一种简单的英文词典排版系统的实现报告Word文档格式.docx_第5页
第5页 / 共12页
点击查看更多>>
下载资源
资源描述

一种简单的英文词典排版系统的实现报告Word文档格式.docx

《一种简单的英文词典排版系统的实现报告Word文档格式.docx》由会员分享,可在线阅读,更多相关《一种简单的英文词典排版系统的实现报告Word文档格式.docx(12页珍藏版)》请在冰豆网上搜索。

一种简单的英文词典排版系统的实现报告Word文档格式.docx

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语言必须要多练习才能学得好,所以我以后要坚持多练习,努力通过计算机等级考试

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 党团工作 > 入党转正申请

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1