背單詞軟體(大一課設作業)

2021-08-15 22:48:38 字數 2338 閱讀 5698

#include

#include

#include

#include

int main()

}a[x++]=suiji;

strcpy(word[i],sum[suiji]);

a:;}

printf("請記憶下面的單詞:\n");

for (int i=0;iprintf("%d %s\n",i+1,word[i]);

printf("----------選單-----------\n");

printf("輸入1將上述某個單詞加入到生詞本中\n輸入2再記憶5個單詞\n輸入3檢視生詞本\n輸入4清空生詞本\n輸入0結束記憶\n");

printf("-------------------------\n請輸入指令:");

c:;//此處用char型別陣列,便於判斷命令是否正確

scanf("%s",minling);

if (strlen(minling)>1)

if (strlen(minling)==1)

}if (minling[0]=='1')

//回到生詞本.txt頭部

fp=fopen("生詞本.txt","r");//唯讀

while (fscanf(fp,"%s",word)==1)

}printf("該單詞已存入生詞本\n\n");

fp=fopen("生詞本.txt","a+");//修改

fprintf(fp," %s",word[hao-1]);

fclose(fp);

//每次以a+方式開啟,需要關閉檔案便於下次重新讀取

b:;goto d;

}else

if (minling[0]=='2')

system("cls");

else

if (minling[0]=='3')

else

if (minling[0]=='4')

else

if (minling[0]=='0')

break;

}system("cls");

printf("您的生詞本如下:\n\n");

//回到生詞本.txt頭部

fp=fopen("生詞本.txt","r");//唯讀

//輸出生詞本

while (fscanf(fp,"%s",word)==1)

puts(word);

printf("\n");

printf("下面您將進行乙個生詞測驗\n\n");

system("pause");

system("cls");

//oj系統

char ch;//輸入

count=0;//統計生詞本中單詞個數

int trues=0,flag;//統計正確數

//回到生詞本.txt頭部

fp=fopen("生詞本.txt","r");//唯讀

while (fscanf(fp,"%s",word)==1)

printf("請輸入單詞中缺少的字母:");

getchar();//為什麼要getchar()?????

scanf("%c",&ch);

printf("%c",ch);

if (ch==word[suiji])

printf("答對了!\n");

else

if (flag==1)//為避免重複計數,引入flag判斷

trues++;

count++;

}printf("\n通過對生詞本中單詞的測試,您的正確率為%.2lf%%\n",trues*1.0/count*100);

printf("\n----------感謝使用本程式,歡迎下次使用----------\n");

//將測試時間,日期和資料存入促使結果,txt,並在結束時開啟兩個txt文字

system("date /t >> 測試結果.txt");

system("time /t >> 測試結果.txt");

fp=fopen("測試結果.txt","a+");//修改

fprintf(fp,"本次生詞本中單詞的正確率為%.2lf%%\n\n",trues*1.0/count*100);

fclose(fp);//關閉

printf("您的生詞本已開啟\n");

system("生詞本.txt");

printf("您的測試結果的歷史資料已開啟\n");

system("測試結果.txt");

system("pause");

}

大一課設(c語言的綜合運用)

include include include include define len sizeof struct student 定義len為結構體長度 struct student 定義結構體 int n 記錄學生數 為全域性變數 通用 struct student creat 定義函式 建立鍊錶...

大一課程總結

當初你是如何做出選擇計算機專業的決定的?自己對計算機比較感興趣,在了解計算機的就業還有發展之後覺得還不錯所以就選擇該專業 2.對比開篇部落格,哪些方面還存在不足?對於,我還沒有很多的了解,不過我覺得是個不錯的地方分享自己的學習過程 3.回憶整個學期,如果重新來過一次,你打算做哪些 技術上,而不是態度...

樵夫作業第一課

樵夫鎖業第一課2020.01.2 第一課作業 課本上的題目 第二題 print 最高分 str max 85,95,90,98,92 分 print 最低分 str min 85,95,90,98,92 分 print 平均分 str 85 95 90 98 92 5 分 上課的作業 第一題 pri...