![C語言版數(shù)據(jù)結(jié)構(gòu)課程設(shè)計文章編輯系統(tǒng)_第1頁](http://file2.renrendoc.com/fileroot_temp3/2021-7/6/d805a026-26f1-456d-957f-0460a778cc07/d805a026-26f1-456d-957f-0460a778cc071.gif)
![C語言版數(shù)據(jù)結(jié)構(gòu)課程設(shè)計文章編輯系統(tǒng)_第2頁](http://file2.renrendoc.com/fileroot_temp3/2021-7/6/d805a026-26f1-456d-957f-0460a778cc07/d805a026-26f1-456d-957f-0460a778cc072.gif)
![C語言版數(shù)據(jù)結(jié)構(gòu)課程設(shè)計文章編輯系統(tǒng)_第3頁](http://file2.renrendoc.com/fileroot_temp3/2021-7/6/d805a026-26f1-456d-957f-0460a778cc07/d805a026-26f1-456d-957f-0460a778cc073.gif)
![C語言版數(shù)據(jù)結(jié)構(gòu)課程設(shè)計文章編輯系統(tǒng)_第4頁](http://file2.renrendoc.com/fileroot_temp3/2021-7/6/d805a026-26f1-456d-957f-0460a778cc07/d805a026-26f1-456d-957f-0460a778cc074.gif)
![C語言版數(shù)據(jù)結(jié)構(gòu)課程設(shè)計文章編輯系統(tǒng)_第5頁](http://file2.renrendoc.com/fileroot_temp3/2021-7/6/d805a026-26f1-456d-957f-0460a778cc07/d805a026-26f1-456d-957f-0460a778cc075.gif)
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、課程設(shè)計說明書 no.1文章編輯系統(tǒng)1、課程設(shè)計目的(1)較熟練地掌握語言的基本內(nèi)容及程序設(shè)計的基本方法與編程技巧。(2)較熟練地掌握在系統(tǒng)上編輯、編譯、連接和運(yùn)行c程序的方法。(3)通過設(shè)計一個完整程序,掌握數(shù)據(jù)結(jié)構(gòu)的算法編寫、類c語言算法轉(zhuǎn)換成c程序并上機(jī)調(diào)試的基本方法。2、課程設(shè)計方案論證2.1 設(shè)計思路(1)定義結(jié)構(gòu)體 struct line,文本行采用順序存儲,行與行之間采用鏈?zhǔn)酱鎯ξ恼戮庉嬒到y(tǒng)統(tǒng)計字符刪除字符統(tǒng)計文字查找字符圖1:功能模塊圖(2)主要函數(shù):int countnumber(line * &head) /*統(tǒng)計數(shù)字?jǐn)?shù)*/ 沈 陽 大 學(xué)課程設(shè)計說明書 no.2圖2:統(tǒng)計
2、數(shù)字函數(shù)流程圖:開始*p=head,count=0int len=str len(p-data)i=0idatai=48 &p-datainext!p=null結(jié)束nynyn 沈 陽 大 學(xué)課程設(shè)計說明書 no.3int findstring(line * &head,char *str) /*統(tǒng)計str在文章中出現(xiàn)的次數(shù)*/開始count=0;h=0;len1=0; len2=strlen(str);p-datai=str0i+k=0;j=0;p-datai+j=strjk+;j+;k=len2count+;i=i+k-1;結(jié)束ynynny圖3:統(tǒng)計str在文章中的出現(xiàn)次數(shù) 沈 陽 大 學(xué)課
3、程設(shè)計說明書 no.42.2 源程序清單#include #include typedef struct line char *data; struct line *next;line; void create(line * &head)line *p;printf (請輸入一頁文章,以#為結(jié)尾(每行最多輸入80字符!):n);p=(struct line*)malloc(sizeof(struct line); head=p; char tmp200; for(;1;) gets(tmp); if(strlen(tmp)80) printf(每行最多輸入80字符); break; if(tm
4、p0=35)break; p=p-next=(struct line*)malloc(sizeof(struct line); p-data=(char*)malloc(strlen(tmp); strcpy(p-data,tmp); if(tmpstrlen(tmp)-1=35) p-datastrlen(tmp)-1=0; 沈 陽 大 學(xué)課程設(shè)計說明書 no.5 break; p-next=null; head=head-next;int countletter(line * &head) line *p=head; int count=0;do int len=strlen(p-data
5、); for(int i=0;idatai=a&p-dataidatai=a&p-datainext)!=null); return count; int countnumber(line * &head) line *p=head; int count=0; do int len=strlen(p-data); for(int i=0;idatai=48 & p-datainext)!=null); return count;int countspace(line * &head) line *p=head; int count=0; do int len=strlen(p-data); f
6、or(int i=0;idatai=32)count+; while(p=p-next)!=null); return count;/*統(tǒng)計文章的總字?jǐn)?shù)*/int countall(line * &head) line *p=head; int count=0; do count+=strlen(p-data); while(p=p-next)!=null); return count; 沈 陽 大 學(xué)課程設(shè)計說明書 no.7int findstring(line * &head,char *str) line *p=head; int count=0; int h=0; int len1=0
7、; int len2=strlen(str); int i,j,k; do len1=strlen(p-data); for(i=0;idatai=str0)k=0; for(j=0;jdatai+j=strj) k+;if(k=len2)count+;i=i+k-1; while(p=p-next)!=null); return count;void delstringword(char *s,char *str) char *p=strstr(s,str); 沈 陽 大 學(xué)課程設(shè)計說明書 no.8char tmp80; int len=strlen(s); int i=len-strlen
8、(p); int j=i+strlen(str); int count=0; for(int m=0;mi;m+)tmpcount+=sm; for(int n=j;ndata,str)!=null)delstringword(p-data,str);while(p=p-next)!=null); void output(line * &head) line *p=head; do printf(%sn,p-data); while(p=p-next)!=null); 沈 陽 大 學(xué)課程設(shè)計說明書 no.9void main() int i=0; int operate;line * head
9、;create(head); printf(輸入的文章為:n); output(head); printf(n); printf(全部字母數(shù):%d n,countletter(head); printf(數(shù)字個數(shù):%d n,countnumber(head); printf(空格個數(shù): %d n,countspace(head); printf(文章總字?jǐn)?shù): %d n,countall(head); char str120,str220; printf(n); printf(*n); printf(* 菜 單 *n); printf(*n); printf(* 1-統(tǒng)計字符串 *n); pri
10、ntf(* 2-刪除字符串 *n); printf(* 0-退出 *n); printf(*n); do printf(請輸入你要選擇的操作: ); scanf(%d,&operate); switch(operate) 沈 陽 大 學(xué)課程設(shè)計說明書 no.10case 1: printf(請輸入要統(tǒng)計的字符串:); scanf(%s,&str1);printf(%s出現(xiàn)的次數(shù)為:%d n,str1,findstring(head,str1); printf(n);countall(head); countnumber(head);countletter(head);countspace(he
11、ad); break; case 2: printf(請輸入要刪除的某一字符串:); scanf(%s,&str2); delstring(head,str2);printf(刪除%s后的文章為:n,str2);output(head); break; case 0: ;break; while(operate!=0); 沈 陽 大 學(xué)課程設(shè)計說明書 no.113、課程設(shè)計運(yùn)行結(jié)果與分析圖3:初始界面 沈 陽 大 學(xué)課程設(shè)計說明書 no.12圖4:運(yùn)行界面 沈 陽 大 學(xué)課程設(shè)計說明書 no.13輸入1:統(tǒng)計字符數(shù)圖5:統(tǒng)計字符界面 沈 陽 大 學(xué)課程設(shè)計說明書 no.14輸入2:刪除字符圖6:刪除字符 沈 陽 大 學(xué)課程設(shè)計說明書 no.15輸入0:退出程序圖7:退出程序 沈 陽 大 學(xué)課程設(shè)計說明書 no.164、課程設(shè)計體會此次課程設(shè)計使我對數(shù)據(jù)結(jié)構(gòu)方面的知識有了更加深入的了解,也使我認(rèn)識到自己在學(xué)習(xí)編程方面還有很多的不足。今后我要多讀一些編程方面的書籍,不能只拘泥于課本上的知識,并注重理論與實(shí)踐的結(jié)合,多上機(jī)練習(xí)編寫程序,提高自己的實(shí)際動手能力和獨(dú)立思考的能力,不斷充實(shí)自己,更好的掌握編程思想。參考文獻(xiàn)1
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 環(huán)保理念下的現(xiàn)代家居設(shè)計風(fēng)格
- 現(xiàn)代飲食文化與胃腸健康的平衡
- 生產(chǎn)環(huán)境下的操作規(guī)范與質(zhì)量控制
- 現(xiàn)代企業(yè)網(wǎng)絡(luò)攻擊的防范與應(yīng)對
- 現(xiàn)代企業(yè)決策分析與科學(xué)決策
- 2023三年級語文下冊 第八單元 口語交際:趣味故事會配套說課稿 新人教版
- Unit5 Humans and nature Lesson 1 A sea story 說課稿-2024-2025學(xué)年高中英語北師大版(2019)必修第二冊001
- 2024-2025學(xué)年新教材高中數(shù)學(xué) 第五章 三角函數(shù) 5.7 三角函數(shù)的應(yīng)用(2)說課稿 新人教A版必修第一冊
- 2023八年級數(shù)學(xué)下冊 第18章 平行四邊形18.1 平行四邊形的性質(zhì)第2課時 平行四邊形的性質(zhì)定理3說課稿 (新版)華東師大版
- 2023二年級語文上冊 第二單元 2 樹之歌配套說課稿 新人教版
- (人衛(wèi)版第九版?zhèn)魅静W(xué)總論(一))課件
- 壓力性損傷護(hù)理質(zhì)控細(xì)則及集束化管理措施
- 《批判性思維原理和方法》全套教學(xué)課件
- 產(chǎn)后康復(fù)-腹直肌分離
- 丙烯-危險化學(xué)品安全周知卡
- 粉條加工廠建設(shè)項目可行性研究報告
- 《配電網(wǎng)設(shè)施可靠性評價指標(biāo)導(dǎo)則》
- 2024年國家電網(wǎng)招聘之通信類題庫附參考答案(考試直接用)
- CJJ 169-2012城鎮(zhèn)道路路面設(shè)計規(guī)范
- 食品企業(yè)日管控周排查月調(diào)度記錄及其報告格式參考
- 產(chǎn)品質(zhì)量法解讀課件1
評論
0/150
提交評論