?? algo8-1.cpp
字號:
// algo8-1.cpp 檢驗bo8-1.cpp(無序順序表部分)的程序
#include"c1.h"
#include"func8-1.cpp" // 包括數(shù)據(jù)元素類型的定義及對它的操作
#include"c8-1.h" // 靜態(tài)查找表的順序存儲結(jié)構(gòu)
#include"c8-2.h" // 對兩個數(shù)值型關(guān)鍵字比較的約定
#include"bo8-1.cpp" // 靜態(tài)查找表(順序表和有序表)的基本操作(7個)
void main()
{
SSTable st;
int i;
long s;
char filename[13]; // 存儲數(shù)據(jù)文件名(包括路徑)
printf("請輸入數(shù)據(jù)文件名:");
scanf("%s",filename);
Creat_SeqFromFile(st,filename); // 由數(shù)據(jù)文件產(chǎn)生順序靜態(tài)查找表st
for(i=1;i<=st.length;i++) // 依次計算每項數(shù)據(jù)元素的總分
st.elem[i].total=st.elem[i].politics+st.elem[i].Chinese+st.elem[i].English+
st.elem[i].math+st.elem[i].physics+st.elem[i].chemistry+st.elem[i].biology;
printf("準考證號 姓名 政治 語文 外語 數(shù)學 物理 化學 生物 總分\n");
Traverse(st,Visit); // 按順序輸出靜態(tài)查找表st
printf("請輸入待查找人的考號:");
InputKey(s); // 由鍵盤輸入關(guān)鍵字s,在func8-1.cpp中
i=Search_Seq(st,s); // 在靜態(tài)查找表st中順序查找含有關(guān)鍵字s的項的序號
if(i) // 找到
Visit(st.elem[i]); // 輸出該項元素,在func8-1.cpp中
else
printf("未找到\n");
Destroy(st); // 銷毀靜態(tài)查找表st
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -