300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > c语言旅馆信息管理设计 C语言旅馆信息管理系统资料整理(24页)-原创力文档...

c语言旅馆信息管理设计 C语言旅馆信息管理系统资料整理(24页)-原创力文档...

时间:2021-09-26 00:59:37

相关推荐

c语言旅馆信息管理设计 C语言旅馆信息管理系统资料整理(24页)-原创力文档...

*题目:旅店信息管理系统

*小组成员:

#include

#include

#include

#include

#define MIN 1

#define MAX 30

#define LEN sizeof(struct Hotel) //用LEN代替结

构体的"长度"

void regeist();

void out_information();

void search_number();

void show_all();

void search_name();

void change();

void fire();

struct Hotel *load();

FILE *fp;

struct Hotel

{

int room_number;

char name [20];

char sex[10];

char ID [20];

float paid[10];

int inyear ;

int inmonth ;

int inday ;

struct Hotel *next ;

};

struct Hotel *load() //定义load函数读取当前的信息,并存

到内存链表中

{

struct Hotel *head,*pb, *s ;

pb (struct Hotel *)malloc(LEN); //开辟新的节点

s (struct Hotel *)malloc(LEN);

if((pb NULL)||(s NULL))

{

printf ("动态内存分配失败!\n");

getch();

exit(0);

}

if((fp fopen("resturant.txt","rb")) NULL)

{

printf ("无法打开文件!\n");

getch();

exit(0);

}

head pb;

while (fread (s,LEN,1,fp)) //读取当前的信息,并存到链

表中

{

pb->next s;

pb s;

s (struct Hotel *)malloc(LEN);

}

pb->next NULL;

return head ; //返回链表的头指针

}

int main () //崔以博、孙浩浩

{ char choice ;

do {printf ("\n\n欢迎使用旅店信

息管理系统\n\n");

printf ("1.查看旅店信息\n2.查看某一房间信息\n3.查看

旅客信息\n");

printf ("4.查找某一旅客信息\n5.旅客入住\n6.旅客换房

\n7.旅客退房\n8.退出\n");

printf

("\n

\n");

choice getch();

switch (choice)

{

case '1':out_information();break;

case '2':search_number();break;

case '3':show_all();break;

case '4':search_name();break;

case '5':regeist();break;

case '6':change();break;

case '7':fire();brea

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。