av在线观看网站免费,欧美成人aaa片一区国产精品,精品国产乱码久久久久久免费,麻豆果冻传媒2021精品传媒一区,国产精品自在欧美一区

電子文檔交易市場(chǎng)
安卓APP | ios版本
電子文檔交易市場(chǎng)
安卓APP | ios版本

C語(yǔ)言酒店管理系統(tǒng)(最新整理)

7頁(yè)
  • 賣(mài)家[上傳人]:夏**
  • 文檔編號(hào):552323261
  • 上傳時(shí)間:2022-09-09
  • 文檔格式:DOCX
  • 文檔大?。?08.99KB
  • 下載文檔到電腦,查找使用更方便

    15 金貝

    還剩頁(yè)未讀,繼續(xù)閱讀

    / 7 舉報(bào) 版權(quán)申訴 馬上下載
  • 文本預(yù)覽
  • 下載提示
  • 常見(jiàn)問(wèn)題
    • // #include#include #include #include//成員變量的聲明int i,j,k,p=0;char temp[]="";int room[5][5]; clock_t start;//成員方法的聲明void init(){int x,y,z; for(x=0;x<5;x++){for(y=0;y<5;y++){room[x][y]=0;}}}void hotelTitle(){printf("\n-------酒店房間登記與計(jì)費(fèi)管理系統(tǒng) \n");printf("\t1.登記入住\n");printf("\t2.查詢房間的入住情況\n"); printf("\t3.查詢當(dāng)前費(fèi)用\n"); printf("\t4.結(jié)賬退房\n");printf("\t5.退出程序\n");}void hotel_execute(); void hotel_select(); void hotel_outhotel(); void outsystem(); void hotel_total();int main(void){system("color f1"); init();while(1){Loop: hotelTitle();printf("\n 請(qǐng)選擇:"); j=scanf("%d",&k); if(j==0||k<1||k>5){printf("\n 輸入錯(cuò)誤。

      \n\t 請(qǐng)輸入所列出的選項(xiàng)\n\n 3 秒后刷新...Please Weit! Thanks\n"); fflush(stdin);sleep(3000); system("cls"); goto Loop;}else{ switch(k){case 1:hotel_execute();break; case 2:hotel_select();break; case 3:hotel_total();break; case 4:hotel_outhotel();break; case 5:outsystem();return; default:printf("\n\t 系統(tǒng)出錯(cuò)!請(qǐng)聯(lián)系管理員!\n");//怕出現(xiàn) BUG return;}}fflush(stdin); //清空緩存}}//入住登記void hotel_execute(){int x,y,z;printf("請(qǐng)輸入你要住本酒店多少層樓的住房?【1-5】"); fflush(stdin);L:scanf("%d",&x); p=x;if(x>5){printf("不好意思本店沒(méi)有該層樓房\n 請(qǐng)重新選擇:"); goto L;}printf("請(qǐng)輸入你要住第%d 層的幾號(hào)房間?【1-5】",x); fflush(stdin);LP:scanf("%d",&y); if(y>5){printf("不好意思該層樓并無(wú)該房間。

      \n 請(qǐng)重新選擇:"); goto LP;//無(wú)條件的回去 GOTO 語(yǔ)句}if(x>2){//二層以上則 100 元一天printf("\n 提示:該房是貴賓套房,100 元一天\n");}else{printf("\n 提示:該房是標(biāo)準(zhǔn)套房,50 元一天\n");}if(room[x-1][y-1]==0)//判斷該房已經(jīng)入住{room[x-1][y-1]=1;printf("\n 謝謝您的光臨,您已經(jīng)成功登記\n 您的信息如下:\n 入住房間:%d-%d\n",x,y); start=clock();}else{printf("警告:該房已經(jīng)有人入住...請(qǐng)換房入住哈\n");}}//查詢住房信息void hotel_select(){int x,y,z;system("cls");//清空內(nèi)容//以下沒(méi)什么重要的就是控制輸出格式printf("賓館入住情況如下:");printf("\n|-------|--------|--------|--------|--------| |\n");printf("| |"); for(x=1;x<=5;x++){printf("房間號(hào) |");}printf("\n"); for(x=0;x<5;x++){if(x==0){printf("|-------|--------|--------|--------|--------|--------|\n|第%d 層 |",x+1);}else{printf("\n|-------|--------|--------|--------|--------|--------|\n|第%d 層 |",x+1);}for(y=0;y<5;y++)if(room[x][y]==0){printf("空%d-%d |",x+1,y+1);}else{printf("住%d-%d |",x+1,y+1);}if(y+1==5){if(x+1==1||x+1==2)printf(" 該層標(biāo)間均 50 元"); elseprintf(" 該層標(biāo)間均 100 元");}}}printf("\n|-------|--------|--------|--------|--------| |\n");printf("\n 住房信息:\n"); for(x=0,z=0;x<5;x++){for(y=0;y<5;y++){if(room[x][y]!=0){z++;printf("\t%d-%d 有人入住\n",x+1,y+1);}}}if(z==0){printf("\t 現(xiàn)無(wú)人入住本酒店...\n");}}//結(jié)賬void hotel_outhotel(){int x=0,y=0;printf("請(qǐng)輸入您要結(jié)賬退房的樓層編號(hào)?"); scanf("%d",&x);printf("請(qǐng)輸入該樓層退房的房間編號(hào)?"); scanf("%d",&y);if(room[x-1][y-1]==1){room[x-1][y-1]=0;printf("\n\t 房間%d-%d 退房成功,再會(huì)。

      \n",x,y);}else{printf("\n\t 房間%d-%d 退房失敗\n\t\t 原因:未入住,是空房,不需要退...再會(huì)\n",x,y);}}//查看價(jià)錢(qián)void hotel_total(){//在 c 語(yǔ)言中有專門(mén)處理系統(tǒng)時(shí)間,程序計(jì)時(shí)等等功能的庫(kù),即 time.h//在 time.h 中函數(shù) clock_t clock( void )可以完成計(jì)時(shí)功能//這個(gè)函數(shù)返回從“開(kāi)啟這個(gè)程序進(jìn)程”到“程序中調(diào)用 clock()函數(shù)”時(shí)之間的 CPU 時(shí)鐘計(jì)時(shí)單元(clock tick)數(shù),//在 MSDN 中稱之為掛鐘時(shí)間(wal-clock)//其中 clock_t 是用來(lái)保存時(shí)間的數(shù)據(jù)類(lèi)型,在 time.h 文件中,//我們可以找到對(duì)它的定義: #ifndef _CLOCK_T_DEFINED typedef long clock_t;//#define _CLOCK_T_DEFINED #endif 很明顯,clock_t 是一個(gè)長(zhǎng)整形數(shù)在 time.h 文件中,還定義了一個(gè)常量 CLOCKS_PER_SEC,//它用來(lái)表示一秒鐘會(huì)有多少個(gè)時(shí)鐘計(jì)時(shí)單元,//其定義如下: #define CLOCKS_PER_SEC ((clock_t)1000) 可以看到每過(guò)千分之一秒(1 毫秒),//調(diào)用 clock()函數(shù)返回的值就加 1。

      clock_t finish=clock();double duration = (double)(finish - start) / CLOCKS_PER_SEC; double day=duration/60/60/24;//這里是將秒換成天double total=0;printf( "您住了%f 秒鐘...\n",duration);//system("pause");按任意鍵繼續(xù)...if(p>2){ total=day*100; if(day==0){ total=100;}printf("\n 我們旅店是按包天計(jì)費(fèi)的\n 若按小時(shí),您需要付%f 元,但是現(xiàn)在你要付 100元(黑店哈哈)\n",total);//這種計(jì)費(fèi)方式比較現(xiàn)實(shí)符合實(shí)際}else{ total=day*50;if(day==0){total=50;}printf("\n 我們旅店是按包天計(jì)費(fèi)的\n 若按小時(shí),您需要付%f 元,但是現(xiàn)在你要付 50元(黑店哈哈)\n",total);}}//退出void outsystem(){char message[] = "\n 酒店登記計(jì)費(fèi)系統(tǒng).打造酒店中的名牌 ";for(i=0;i

      }printf("\n\n");}//1.本系統(tǒng)未用到文件//2.本系統(tǒng)采用函數(shù)//3.本系統(tǒng)用例比較小//4.本系統(tǒng)有良好的界面,舒適的變成思路和整齊的代碼//5.本程序引用一個(gè)時(shí)間進(jìn)程另外控制時(shí)間//6.感謝所有關(guān)心我和我關(guān)心的人//7.再會(huì)At the end, Xiao Bian gives you a passage. Minand once said, "people who learn to learn are very happy people.". In every wonderful life, learning is an eternal theme. As a professional clerical and teaching position, I understand the importance of continuous learning, "life is diligent, nothing can be gained", only continuous learning can achieve better self. Only by constantly learning and mastering the latest relevant knowledge, can employees from all walks of life keep up with the pace of enterprise development and innovate to meet the needs of the market. This document is also edited by my studio professionals, there may be errors in the document, if there are errors, please correct, thank 。

      點(diǎn)擊閱讀更多內(nèi)容
    關(guān)于金鋤頭網(wǎng) - 版權(quán)申訴 - 免責(zé)聲明 - 誠(chéng)邀英才 - 聯(lián)系我們
    手機(jī)版 | 川公網(wǎng)安備 51140202000112號(hào) | 經(jīng)營(yíng)許可證(蜀ICP備13022795號(hào))
    ?2008-2016 by Sichuan Goldhoe Inc. All Rights Reserved.