日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

c语言宿舍管理查询软件,宿舍管理查询软件--数据结构,c语言

發布時間:2024/9/19 编程问答 41 豆豆
生活随笔 收集整理的這篇文章主要介紹了 c语言宿舍管理查询软件,宿舍管理查询软件--数据结构,c语言 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

四、功能模塊說明

輸入學生宿舍信息模塊:完成宿舍信息的錄入,可以選擇從平臺手動輸入,也可以選擇從指定文件中讀取。

保存學生宿舍信息模塊,完成宿舍信息的保存。

排序學生宿舍信息模塊,完成按關鍵字排序的功能,可以選擇按宿舍號、學號或姓名進行排序。

查詢學生宿舍信息模塊,完成按關鍵字查詢的功能,可以選擇按宿舍號、學號或姓名進行查詢。

瀏覽學生宿舍信息模塊,完成對已經輸入的信息的打印瀏覽,如果沒有向系統輸入數據,將提醒無文件數據存在,請進行輸入。

最后退出系統。

五、實驗過程

#include#include#include#include#includeusing namespace std;

#define Max 100

int total;

struct edg

//構造結構體,創建學生信息的結構體數組,其中的信息包含名字,宿舍房號以及學號 。

{

string name;

int number;

int domenumber;

}student[Max];

edg s[Max];

void menu() //主菜單的函數包含3個功能(新建,排序,查詢,打印)

{

cout<>total;

if(ofs)

{

for(i=1;i<=total;i++) //為每個同學輸入信息

{

cout<>a;

student[i].name=a;

ofs<>b;

student[i].number=b;

ofs<>c;

student[i].domenumber=c;

ofs

return -1;

int mid=(left+right)/2;

if(student[mid].number==key) //剛好要查找的對象key在mid這個位置,查找成功

return mid;

else if(student[mid].number>choice;

break;

}

if(choice[0]=='1') //進行以學號為關鍵字的排序

{

for(i=1;i<=total;i++) //用冒泡排序法進行排序

for(j=1;j=student[j+1].number)

{

edg temp;

temp=student[j];

student[j]=student[j+1];

student[j+1]=temp;

}

cout<=student[j+1].domenumber)

{

edg temp;

temp=student[j];

student[j]=student[j+1];

student[j+1]=temp;

}

cout<=student[j+1].name)

{

edg temp;

temp=student[j];

student[j]=student[j+1];

student[j+1]=temp;

}

cout<>choice;

break;

}

if(choice[0]=='1')

{

cout<>a;

for(i=1;i<=total;i++)

{

//c_str返回當前的字符串的首地址,c_str()把string對象轉換成c中的字符串樣式

if(strcmp(student[i].name.c_str(),a.c_str())==0) s[i]=student[i];

break;

}

if(i!=total+1)

{

cout<>choice1;

if(choice1[0]=='s')

{

cout<>choice1;

if(choice1[0]=='s')

{

cout<>b;

//int len=b.size(); //b.length為字符串b的長度,b.size()為字符串b的元素個數

if(bin_search(1,total,b)!=-1) //b為關鍵字 使用二分的方法來找到位置,若return結果為-1則表示學號沒有錄入系統中

{

s[i]=student[bin_search(1,total,b)];

cout<>choice1;

if(choice1[0]=='s')

{

cout<>choice1;

if(choice1[0]=='s')

{

cout<>c;

for(i=1;i<=total;i++)

{

if(c==student[i].domenumber)

{

s[i]=student[i];

cout<>choice1;

if(choice1[0]=='s')

{

cout<>choice;

if(choice[0]=='1')

{

build();

cout<>choice;

if(choice[0]=='s')

{

system("cls");

menu();

}

else

break;

}

else if(choice[0]=='2')

{

sortmenu();

cout<>choice;

if(choice[0]=='s')

{

system("cls");

menu();

}

else

break;

}

else if(choice[0]=='3')

{

query();

cout<>choice;

if(choice[0]=='s')

{

system("cls");

menu();

}

else

break;

}

else if(choice[0]=='4')

{

print();

cout<>choice;

if(choice[0]=='s')

{

system("cls");

menu();

}

else

break;

}

else

{

cout<

與50位技術專家面對面20年技術見證,附贈技術全景圖

總結

以上是生活随笔為你收集整理的c语言宿舍管理查询软件,宿舍管理查询软件--数据结构,c语言的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。