王朝 電子詞典163 1煙台大學

2021-07-25 19:44:49 字數 758 閱讀 8551

功能描述:電子詞典查詢某個單詞

輸入引數:word-要查詢的單詞

e,c-儲存資料的陣列

返 回 值:mid,-1;

其他說明:無

#include #include #includechar e[8000][30],c[8000][30],word[30];//定義英文漢語和要查的單詞,規定字元長度太短,致使不可正確讀入

int i=0;

int fun(int low, int high, char *w);//定義二分法函式

int main( )

while(fscanf(fin,"%s%s",e[i],c[i])!=eof)//將檔案全部讀入並統計單詞個數

fclose(fin);

printf("電子詞典\n");

do//輸入查詢的單詞

}while(1);

return 0;

}int fun(int low, int high, char *w)

else if(strcmp(e[mid],w)>0)

high=mid-1; //在low,mid-1中找

else

low=mid+1; //或在mid+1,high中查詢

}return -1; //當low>high時表示查詢區間為空,查詢失敗

mysql電子詞典 電子詞典

一 功能說明使用者可以登入和註冊 登入憑藉使用者名稱和密碼登入 註冊要求使用者必須填寫使用者名稱,密碼,其他內容自定 使用者名稱要求不能重複 要求使用者資訊能夠長期儲存可以通過基本的圖形介面print以提示客戶端輸入。程式分為服務端和客戶端兩部分 客戶端通過print列印簡單介面輸入命令發起請求 服...

簡易電子詞典

01 0203 0405 0607 0809 1011 1213 1415 1617 1819 2021 2223 2425 2627 2829 3031 3233 3435 3637 3839 4041 4243 4445 4647 4849 5051 5253 5455 5657 5859 60...

SQLite 電子詞典

伺服器部分 段 include include include include include include include include include include define n 16 define r 1 user register define l 2 user login def...