下载此文档

酒店管理系统C语言版.doc


文档分类:IT计算机 | 页数:约6页 举报非法文档有奖
1/6
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/6 下载此文档
文档列表 文档介绍
#include<>#include<>structpeopledata{ charname[11]; charsex[3]; intage;intidcard[2];};structdate{ intyear; intmonth; intday; inttime;//住宿时间。};typedefstruct{ intnumber; charkind; structpeopledatapeople; structdatetime;}rooms;voidadddata(){ FILE*fp; roomsroom; chartag,select; inti; do{printf("房间编号:"); scanf("%d",&); fflush(stdin); printf("房间类型:"); scanf("%c",&); printf("住宿人员信息:\n");printf("\t\t姓名:"); fflush(stdin); scanf("%s",); fflush(stdin); printf("\t\t性别:"); gets(); printf("\t\t年龄:"); scanf("%d",&); printf("\t\t请输入身份证号码:"); for(i=0;i<2;i++) scanf("%d",&[i]); printf("入住时间:\n"); printf("\t\t年:"); scanf("%d",&); printf("\t\t月:"); scanf("%d",&); printf("\t\t日:"); scanf("%d",&); printf("入住时长:"); scanf("%d",&); fflush(stdin); if((fp=fopen("d:\\","a"))==NULL) { printf("打开文件”酒店住宿登记表“失败,按任意键退出。\n"); exit(0); } else { printf("确定要写入资料吗?(y/n)\n");scanf("%c",&select); fflush(stdin); if(select=='y') { fwrite(&room,sizeof(rooms),1,fp); if(ferror(fp)!=0) { printf("写入资料失败,按任意键退出。\n"); exit(0); } printf("要继续添加?(y/n)\n"); scanf("%c",&tag);fflush(stdin); } else { printf("要继续添加吗?(y/n)\n"); scanf("%c",&tag); fflush(stdin); } } fclose(fp); } while(tag=='y');}voidupdata(){ FILE*fp; roomsroom; intnumber,i; printf("请输入要更新的信息的房间编号:\n"); sc

酒店管理系统C语言版 来自淘豆网www.taodocs.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
最近更新