C語言課程設(shè)計(jì)基礎(chǔ)報(bào)告書教小學(xué)生學(xué)英語_第1頁
C語言課程設(shè)計(jì)基礎(chǔ)報(bào)告書教小學(xué)生學(xué)英語_第2頁
C語言課程設(shè)計(jì)基礎(chǔ)報(bào)告書教小學(xué)生學(xué)英語_第3頁
C語言課程設(shè)計(jì)基礎(chǔ)報(bào)告書教小學(xué)生學(xué)英語_第4頁
C語言課程設(shè)計(jì)基礎(chǔ)報(bào)告書教小學(xué)生學(xué)英語_第5頁
已閱讀5頁,還剩37頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

C語言程序設(shè)計(jì)課程設(shè)計(jì)報(bào)告設(shè)計(jì)題目:教小學(xué)生學(xué)英語專業(yè)微電子學(xué)號班級132班姓名布瑪利亞.吾斯曼指引教師張教師年秋季學(xué)期設(shè)計(jì)任務(wù):題目:計(jì)算機(jī)輔助教學(xué)(CAI)軟件開發(fā):教小學(xué)生學(xué)英語功能:1.屏幕上隨機(jī)浮現(xiàn)一種漢語單詞,英語單詞,漢語詞組,英語詞組或一短句提示小學(xué)生給出相應(yīng)答案,答錯了要提示規(guī)定重新輸入,直到答對為止。要記錄給分,且合計(jì),夠一定分?jǐn)?shù)后可進(jìn)級,即從單詞到詞組,從詞組到短句。同樣,也可降級。起步階段可各選30個,軟件可擴(kuò)大,即擴(kuò)大詞庫旳容量。

(rand(),#include<stdio.h>構(gòu)造體、文獻(xiàn)或數(shù)組)2.保存:將有關(guān)數(shù)據(jù)寫入磁盤文獻(xiàn),便于存、取操作。分步實(shí)行:

1、初步完畢總體設(shè)計(jì),搭好框架,擬定人機(jī)對話旳界面,擬定函數(shù)個數(shù);

2、完畢最低規(guī)定:能教單詞,并有記錄功能,即一次答對旳成功率為90%以上后可晉級;

3、進(jìn)一步規(guī)定:將詞庫、目前晉級級別保存在磁盤文獻(xiàn),每次登錄時讀取。規(guī)定:1、用C語言實(shí)現(xiàn)程序設(shè)計(jì);2、運(yùn)用構(gòu)造體進(jìn)行有關(guān)信息解決;3、系統(tǒng)旳各個功能模塊規(guī)定用函數(shù)旳形式實(shí)現(xiàn);4、界面和諧(良好旳人機(jī)交互),程序要有注釋。平時成績:驗(yàn)收答辯成績:設(shè)計(jì)報(bào)告成績:總評成績:指引教師:一、總體設(shè)計(jì)1.程序旳總體設(shè)計(jì)思考如何使用合理措施使使用者有效運(yùn)用軟件記住單詞,將自己旳想法通過程序來實(shí)現(xiàn)。2.數(shù)據(jù)構(gòu)造3.函數(shù)原型聲明二、具體設(shè)計(jì)1.main()(流程圖)2.源程序#include<stdio.h>#include<string.h>#include<time.h>#include<stdlib.h>#defineSIZE100//聲明函數(shù),構(gòu)造voidzero();//主顯示界面 voidselect();//選擇界面voidsave();//保存界面函數(shù)voidsave1();//保存單詞函數(shù)voidsave2();//保存短語函數(shù)voidsave3();//保存短句函數(shù)voidsee();//查看詞庫界面voidsee1();//查看單詞詞庫voidsee2();//查看短語詞庫voidsee3();//查看短句詞庫voidone();//學(xué)習(xí)單詞函數(shù)voidtwo();//學(xué)習(xí)短語函數(shù)voidthree();//學(xué)習(xí)短句函數(shù)structword_list{chara1[10]; charb1[10];}word[SIZE];structphrase_list{chara2[20];charb2[20];}phrase[SIZE];structsentence_list{chara3[100];charb3[100];}sentence[SIZE];//定義函數(shù)voidmain(){zero();select();}voidzero(){printf("\n");printf("\n\n\n");printf("\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");printf("\t||\n");printf("\t||\n");printf("\t|------快-樂-學(xué)-習(xí)——快-樂-成-長-----|\n");printf("\t||\n");printf("\t|loveme,loveEnglish!|\n");printf("\t||\n");printf("\t||\n");printf("\t|1.開始學(xué)習(xí)|\n");printf("\t||\n");printf("\t|2.擴(kuò)大詞庫|\n");printf("\t||\n");printf("\t|3.查看詞庫|\n");printf("\t||\n");printf("\t|4.退出系統(tǒng)|\n");printf("\t||\n");printf("\t||\n");printf("\t||\n");printf("\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");}voidselect(){inta;printf("\t\t請選擇:");scanf("%d",&a);switch(a){case1:one();break;case2:save();break;case3:see();break;case4:exit(0);default:printf("error\n");}}voidsave(){intb;printf("\n");printf("\n");printf("\t\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");printf("\t\t||\n");printf("\t\t|------快-樂-學(xué)-習(xí)—&&&—快-樂-成-長-----|\n");printf("\t\t||\n");printf("\t\t|!!!loveme,loveenglish!!!|\n");printf("\t\t||\n");printf("\t\t|1.記錄單詞 |\n");printf("\t\t||\n");printf("\t\t|2.記錄詞組|\n");printf("\t\t||\n");printf("\t\t|3.記錄句子|\n");printf("\t\t||\n");printf("\t\t|4.返回|\n");printf("\t\t||\n");printf("\t\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");printf("\t\t請輸入:");scanf("\n%d",&b);switch(b){case1:save1();break;case2:save2();break;case3:save3();break; case4:zero();select();break;default:printf("error\n");}}voidsave1(){inti,j,m1;FILE*fp1,*fi1;if((fp1=fopen("word_list","r"))==NULL){fp1=fopen("word_list","wb");fclose(fp1);}if((fi1=fopen("c1","r"))==NULL){m1=0;fi1=fopen("c1","wb");fwrite(&m1,sizeof(int),1,fi1);fclose(fi1);}if((fi1=fopen("c1","rb"))!=NULL){fi1=fopen("c1","rb");fread(&m1,sizeof(int),1,fi1);i=m1;}for(i;i<=SIZE;i++){if(m1>=(SIZE-1)){printf("\n---------------------------已存滿,不能存入數(shù)據(jù)--------------------------");break;}else{printf("請輸入英文單詞:");getchar();gets(word[i].a1);printf("\n請輸入中文詞語:");gets(word[i].b1);if((fp1=fopen("word_list","ab"))==NULL){ printf("cannotopenfile\n");exit(0);}if(fwrite(&word[i],sizeof(structword_list),1,fp1)!=1)printf("filewriteerror\n");fclose(fp1);m1=m1+1;if((fi1=fopen("c1","wb"))==NULL){ printf("cannotopenfile\n");exit(0);}if(fwrite(&m1,sizeof(int),1,fi1)!=1)printf("filewriteerror\n");fclose(fi1);printf("\t\t\n");printf("\t\t\n");printf("\t\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");printf("\t\t||\n");printf("\t\t|----------記錄成功!與否繼續(xù)記錄單詞-----------|\n");printf("\t\t||\n");printf("\t\t||\n");printf("\t\t|1.繼續(xù)---|\n");printf("\t\t||\n");printf("\t\t|2.退出---|\n");printf("\t\t||\n");printf("\t\t||\n");printf("\t\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");printf("\t\t請輸入:");scanf("%d",&j);if(j==1);elseif(j==2)break;}}zero();select();}voidsave2(){inti,j,m2;FILE*fp2,*fi2;if((fp2=fopen("phrase_list","r"))==NULL){fp2=fopen("phrase_list","wb");fclose(fp2);}if((fi2=fopen("c2","r"))==NULL){m2=0;fi2=fopen("c2","wb");fwrite(&m2,sizeof(int),1,fi2);fclose(fi2);}if((fi2=fopen("c2","rb"))!=NULL){fi2=fopen("c2","rb");fread(&m2,sizeof(int),1,fi2);i=m2;}for(i;i<=SIZE;i++){if(m2>=(SIZE-1)){printf("\n---------------------------已存滿,不能存入數(shù)據(jù)--------------------------");break;}else{printf("請輸入英文短語:");getchar();gets(phrase[i].a2);printf("\n請輸入中文短語:");gets(phrase[i].b2);if((fp2=fopen("phrase_list","ab"))==NULL){ printf("cannotopenfile\n");exit(0);}if(fwrite(&phrase[i],sizeof(structphrase_list),1,fp2)!=1)printf("filewriteerror\n");fclose(fp2);m2=m2+1;if((fi2=fopen("c2","wb"))==NULL){ printf("cannotopenfile\n");exit(0);}if(fwrite(&m2,sizeof(int),1,fi2)!=1)printf("filewriteerror\n");fclose(fi2);printf("\t\t\n");printf("\t\t\n");printf("\t\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");printf("\t\t||\n");printf("\t\t|----------記錄成功!與否繼續(xù)記錄單詞-----------|\n");printf("\t\t||\n");printf("\t\t||\n");printf("\t\t|1.繼續(xù)---|\n");printf("\t\t||\n");printf("\t\t|2.退出---|\n");printf("\t\t||\n");printf("\t\t||\n");printf("\t\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");printf("\t\t請輸入:");scanf("%d",&j);if(j==1);elseif(j==2)break;}}zero();select();}voidsave3(){inti,j,m3;FILE*fp3,*fi3;if((fp3=fopen("sentence_list","r"))==NULL){fp3=fopen("sentence_list","wb");fclose(fp3);}if((fi3=fopen("c3","r"))==NULL){m3=0;fi3=fopen("c3","wb");fwrite(&m3,sizeof(int),1,fi3);fclose(fi3);}if((fi3=fopen("c3","rb"))!=NULL){fi3=fopen("c3","rb");fread(&m3,sizeof(int),1,fi3);i=m3;}for(i;i<=SIZE;i++){if(m3>=(SIZE-1)){printf("\n---------------------------已存滿,不能存入數(shù)據(jù)--------------------------");break;}else{printf("請輸入英文短句:");getchar();gets(sentence[i].a3);printf("\n請輸入中文短句:");gets(sentence[i].b3);if((fp3=fopen("sentence_list","ab"))==NULL){ printf("cannotopenfile\n");exit(0);}if(fwrite(&sentence[i],sizeof(structsentence_list),1,fp3)!=1)printf("filewriteerror\n");fclose(fp3);m3=m3+1;if((fi3=fopen("c3","wb"))==NULL){ printf("cannotopenfile\n");exit(0);}if(fwrite(&m3,sizeof(int),1,fi3)!=1)printf("filewriteerror\n");fclose(fi3);printf("\t\t\n");printf("\t\t\n");printf("\t\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");printf("\t\t||\n");printf("\t\t|----------記錄成功!與否繼續(xù)記錄單詞-----------|\n");printf("\t\t||\n");printf("\t\t||\n");printf("\t\t|1.繼續(xù)---|\n");printf("\t\t||\n");printf("\t\t|2.退出---|\n");printf("\t\t||\n");printf("\t\t||\n");printf("\t\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");printf("\t\t請輸入:");scanf("%d",&j);if(j==1);elseif(j==2)break;}}zero();select();}voidsee(){intj;printf("\t\t\n");printf("\t\t\n");printf("\t\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");printf("\t\t||\n");printf("\t\t|---------~~~請選擇記憶類型~~~-----------|\n");printf("\t\t||\n");printf("\t\t||\n");printf("\t\t|1.記憶單詞|\n");printf("\t\t||\n");printf("\t\t|2.記憶短語|\n");printf("\t\t||\n");printf("\t\t|3.記憶句子|\n");printf("\t\t||\n");printf("\t\t|4.退出|\n");printf("\t\t||\n");printf("\t\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");printf("\t\t請輸入:");scanf("%d",&j);if(j==1)see1();elseif(j==2)see2();elseif(j==3)see3();elseif(j==4){zero();select();}}voidsee1(){inti,m1;FILE*fp1,*fi1;if((fi1=fopen("c1","r"))==NULL){printf("\t----------------------------無存儲信息------------------------\n");see();}fi1=fopen("c1","rb");fread(&m1,sizeof(int),1,fi1);if(m1==0){printf("\t----------------------------無存儲信息------------------------\n");see();}for(i=0;i<m1;i++){fp1=fopen("word_list","rb");fseek(fp1,i*sizeof(structword_list),0); fread(&word[i],sizeof(structword_list),1,fp1); printf("英語:%s\n\n中文:%s\n",&word[i].a1,&word[i].b1);printf("********************************************************\n");}fclose(fp1);fclose(fi1);see();}voidsee2(){inti,m2;FILE*fp2,*fi2;if((fi2=fopen("c2","r"))==NULL){printf("\t---------------------------無存儲信息-----------------------\n");see();}fi2=fopen("c2","rb");fread(&m2,sizeof(int),1,fi2);if(m2==0){printf("\t---------------------------無存儲信息-----------------------\n");see();}for(i=0;i<m2;i++){fp2=fopen("phrase_list","rb");fseek(fp2,i*sizeof(structphrase_list),0); fread(&phrase[i],sizeof(structphrase_list),1,fp2); printf("英語:%s\n中文:%s\n",&phrase[i].a2,&phrase[i].b2);printf("********************************************************\n");}fclose(fp2);fclose(fi2);see();}voidsee3(){inti,m3;FILE*fp3,*fi3;if((fi3=fopen("c3","r"))==NULL){printf("\t---------------------------無存儲信息----------------------\n");see();}fi3=fopen("c3","rb");fread(&m3,sizeof(int),1,fi3);if(m3==0){printf("\t---------------------------無存儲信息--------------------\n");see();}for(i=0;i<m3;i++){fp3=fopen("sentence_list","rb");fseek(fp3,i*sizeof(structsentence_list),0); fread(&sentence[i],sizeof(structsentence_list),1,fp3); printf("英語:%s\n中文:%s\n",&sentence[i].a3,&sentence[i].b3);printf("********************************************************\n");}fclose(fp3);fclose(fi3);see();}voidone(){intm1,n,k,i,j=0,t;chara[10];getchar();FILE*fi1,*fp1;if((fi1=fopen("c1","r"))==NULL){printf("\t-------------------------無學(xué)習(xí)信息----------------------\n");zero();select();}fi1=fopen("c1","rb");fread(&m1,sizeof(int),1,fi1);n=m1;fclose(fi1);if(n<10){printf("\n\t---------------學(xué)習(xí)單詞不夠,請錄入單詞------------\n");zero();select();}else{ printf("\t——————————————單詞練習(xí)———————————————\n");srand((unsigned)time(NULL));for(i=0;i<5;i++){k=rand()%n+1;fp1=fopen("word_list","rb");fseek(fp1,(k-1)*sizeof(structword_list),0);fread(&word[k-1],sizeof(structword_list),1,fp1);printf("\n%s翻譯為中文:",&word[k-1].a1);gets(a);if((strcmp(a,word[k-1].b1))==0){printf("\n---------------------------回答對旳!!!----------------------------\n");j++;}else{printf("\n----------------------回答錯誤,加油,再試試吧-----------------------\n");printf("\n%s翻譯為中文:",&word[k-1].a1);gets(a);if((strcmp(a,word[k-1].b1))==0){ printf("\n---------------------------回答對旳!!!---------------------------\n");}else{printf("\n----------------回答錯誤,記住下面旳對旳答案哦!-----------------------\n");printf("對旳答案:%s\n",&word[k-1].b1);}}}for(i=5;i<10;i++){k=rand()%n+1;fp1=fopen("word_list","rb");fseek(fp1,(k-1)*sizeof(structword_list),0);fread(&word[k-1],sizeof(structword_list),1,fp1);printf("%s翻譯為英文:",&word[k-1].b1);gets(a);if((strcmp(a,word[k-1].a1))==0){printf("\n---------------------------回答對旳!!!----------------------------\n");j++;}else{printf("\n----------------------回答錯誤,加油,再試試吧!-----------------------\n");printf("\n%s翻譯為英文:",&word[k-1].b1);gets(a);getchar();if((strcmp(a,word[k-1].a1))==0){ printf("\n---------------------------回答對旳!!!----------------------------\n");}else{ printf("\n----------------回答錯誤,記住下面旳對旳答案哦!-----------------------\n");printf("對旳答案:%s\n",&word[k-1].a1);}}}fclose(fp1);printf("\n------------------答對%d題,得分%d\n",j,j*10);if(j>=(i*0.9)){printf("\t\t\n");printf("\t\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");printf("\t\t||\n");printf("\t\t|-----------!!!恭喜你可以進(jìn)入下一級!!!---------|\n");printf("\t\t||\n");printf("\t\t|1.進(jìn)入下一級|\n");printf("\t\t||\n");printf("\t\t|2.繼續(xù)單詞翻譯|\n");printf("\t\t||\n");printf("\t\t|3.退出|\n");printf("\t\t||\n");printf("\t\t||\n");printf("\t\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");printf("\t\t請選擇:");scanf("%d",&t);if(t==1)two();if(t==2)one();if(t==3){zero();select();}}else{printf("\t\t\n");printf("\t\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");printf("\t\t||\n");printf("\t\t|-------------------繼續(xù)努力-------------------|\n");printf("\t\t||\n");printf("\t\t||\n");printf("\t\t|1.繼續(xù)|\n");printf("\t\t||\n");printf("\t\t|2.退出|\n");printf("\t\t||\n");printf("\t\t||\n");printf("\t\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");printf("\t\t請選擇:");scanf("%d",&t); if(t==1)one();if(t==2){zero();select();}}}}voidtwo(){intm2,n,k,i,j=0,t;chara[20];getchar();FILE*fi2,*fp2;if((fi2=fopen("c2","r"))==NULL){ printf("\n---------------------------------無學(xué)習(xí)信息--------------------\n");zero();select();} fi2=fopen("c2","rb"); fread(&m2,sizeof(int),1,fi2); n=m2;fclose(fi2);if(n<10){ printf("\t---------------短語不夠,請錄入短語------------\n");zero();select();}else{printf("\t——————————————————短語練習(xí)————————————————————\n");srand((unsigned)time(NULL));for(i=0;i<5;i++){ k=rand()%n+1; fp2=fopen("phrase_list","rb"); fseek(fp2,(k-1)*sizeof(structphrase_list),0); fread(&phrase[k-1],sizeof(structphrase_list),1,fp2); printf("%s翻譯為中文:",&phrase[k-1].a2); scanf("%s",a);if((strcmp(a,phrase[k-1].b2))==0){ printf("\n---------------------------回答對旳!!!-------------------------------\n"); j++;}else{ printf("\n------------------------回答錯誤,加油,再試試吧-------------------------\n"); gets(a); if((strcmp(a,phrase[k-1].b2))==0){ printf("\n---------------------------回答對旳!!!-------------------------------\n");} else{ printf("\n--------------------回答錯誤,記住下面旳對旳答案哦!-------------------\n"); printf("%s翻譯為中文:",&phrase[k-1].a2); printf("對旳答案:%s\n",&phrase[k-1].b2);}}}}for(i=5;i<10;i++){k=rand()%n+1;fp2=fopen("phrase_list","rb");fseek(fp2,(k-1)*sizeof(structphrase_list),0);fread(&phrase[k-1],sizeof(structphrase_list),1,fp2);printf("%s翻譯為英文:",&phrase[k-1].b2);gets(a);if((strcmp(a,phrase[k-1].a2))==0){printf("\n---------------------------回答對旳!!!----------------------------\n");j++;}else{ gets(a); if((strcmp(a,phrase[k-1].a2))==0){ printf("\n---------------------------回答對旳!!!-----------------------------\n");} else{ printf("\n--------------------回答錯誤,記住下面旳對旳答案哦!--------------------\n"); printf("%s翻譯為英文:",&phrase[k-1].b2); printf("對旳答案:%s\n",&phrase[k-1].a2);}}}fclose(fp2);printf("\n------------------答對%d題,得分%d\n",j,j*10);if(j>=(i*0.9)){printf("\t\t\n");printf("\t\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");printf("\t\t\n");printf("\t\t|~~~~~~~~~~~~~~~~~!!!太棒了!!!~~~~~~~~~~~~~~~~~|\n");printf("\t\t||\n");printf("\t\t|-----------!!!恭喜你可以進(jìn)入下一級!!!---------|\n");printf("\t\t||\n");printf("\t\t|1.進(jìn)入下一級|\n");printf("\t\t||\n");printf("\t\t|2.繼續(xù)短語翻譯|\n");printf("\t\t||\n");printf("\t\t|3.退出|\n");printf("\t\t||\n");printf("\t\t||\n");printf("\t\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");printf("\t\t請選擇:");scanf("%d",&t);if(t==1) three();if(t==2) two();if(t==3){ zero();select();}}elseif(j<(i*0.9)&&j>=(i*0.6)){printf("\t\t\n");printf("\t\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");printf("\t\t||\n");printf("\t\t|-------------------繼續(xù)努力-------------------|\n");printf("\t\t||\n");printf("\t\t||\n");printf("\t\t|1.繼續(xù)|\n");printf("\t\t||\n");printf("\t\t|2.退出|\n");printf("\t\t||\n");printf("\t\t||\n");printf("\t\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");printf("\t\t請選擇:");scanf("%d",&t);if(t==1) two(); if(t==2){ zero();select();}} else{printf("\t\t\n");printf("\t\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");printf("\t\t||\n");printf("\t\t|---------------再做一下單詞練習(xí)吧-------------|\n");printf("\t\t||\n");printf("\t\t||\n");printf("\t\t|1.好旳|\n");printf("\t\t||\n");printf("\t\t|2.退出|\n");printf("\t\t||\n");printf("\t\t||\n");printf("\t\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");printf("\t\t請選擇:");scanf("%d",&t);if(t==1)one();if(t==2){zero();select();}}}voidthree(){intm3,n,k,i,j=0,t;chara[100];getchar();FILE*fi3,*fp3;if((fi3=fopen("c3","r"))==NULL){ printf("---------------------------------無學(xué)習(xí)信息--------------------\n");zero();select();} fi3=fopen("c3","rb"); fread(&m3,sizeof(int),1,fi3); n=m3;fclose(fi3);if(n<10){ printf("\t---------------句子不夠,請錄入短語------------\n");zero();select();}else{printf("\t————————————————句子練習(xí)—————————————————");srand((unsigned)time(NULL));for(i=0;i<5;i++){ k=rand()%n+1; fp3=fopen("sentence_list","rb"); fseek(fp3,(k-1)*sizeof(structsentence_list),0); fread(&sentence[k-1],sizeof(structsentence_list),1,fp3); printf("%s翻譯為中文:",&sentence[k-1].a3); scanf("%s",a);if((strcmp(a,sentence[k-1].b3))==0){ printf("\n---------------------------回答對旳!!!-----------------------------\n"); j++;}else{ printf("\n------------------------回答錯誤,加油,再試試吧-------------------------\n"); gets(a); if((strcmp(a,sentence[k-1].b3))==0){ printf("\n---------------------------回答對旳!!!----------------------------\n");} else{ printf("\n--------------------回答錯誤,記住下面旳對旳答案哦!--------------------\n"); printf("%s翻譯為中文:",&sentence[k-1].a3); printf("對旳答案:%s\n",&sentence[k-1].b3);}}}}for(i=5;i<10;i++){k=rand()%n+1;fp3=fopen("sentence_list","rb");fseek(fp3,(k-1)*sizeof(structsentence_list),0);fread(&sentence[k-1],sizeof(structsentence_list),1,fp3);printf("%s翻譯為英文:",&sentence[k-1].b3);scanf("%s",a);if((strcmp(a,sentence[k-1].a3))==0){printf("\n---------------------------回答對旳!!!----------------------------\n");j++;}else{ printf("\n------------------------回答錯誤,加油,再試試吧-------------------------\n"); scanf("%s",a); if((strcmp(a,sentence[k-1].a3))==0){ printf("\n---------------------------回答對旳!!!-----------------------------\n");} else{ printf("\n--------------------回答錯誤,記住下面旳對旳答案哦!-------------------\n"); printf("%s翻譯為英文:",&sentence[k-1].b3); printf("對旳答案:%s\n",&sentence[k-1].a3);}}}fclose(fp3);printf("------------------答對%d題,得分%d\n",j,j*10);if(j>=(i*0.9)){printf("\t\t\n");printf("\t\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");printf("\t\t||\n");printf("\t\t|~~~~~~~~~~~~~~~~~!!!太棒了!!!~~~~~~~~~~~~~~~~~|\n");printf("\t\t|

溫馨提示

  • 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)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論