| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 374 人关注过本帖
标题:如何往这里加点东西!高手帮忙解答
只看楼主 加入收藏
F13
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2010-6-23
结帖率:100%
收藏
已结贴  问题点数:5 回复次数:3 
如何往这里加点东西!高手帮忙解答

#include<stdio.h>
void xx();
void search();
main()
{ int f;
printf(" ▲***********************▲\n");
printf(" △ 欢迎来到XXX饭店△\n");
printf(" ▲************************▲\n");
printf("1.进入. 2退出.\n");
scanf("%d",&f);
if(f==1)
search();
else
printf("输入错误");
}
void search()
{
int d[15],g[3],a,b,c,x,y,h;
printf("请选择您需要的号码:\n1.预定房间\n2.退定房间\n");
scanf("%d",&a);
if(a>3 || a<1)
{printf("您输入有误请您重试!\n");
}

else switch(a)                                 
{ case 1:               
{ printf("请您输入您的身份证号码\n");                          {我想在这个之前加个“输入姓名”;我总是加错,高手帮忙}
scanf("%d",&d[15]);
printf("您已登陆成功^-^\n");
printf("请您选择退定种类:\n");
printf("1.单人间/夜150元\n2.双人间/夜200元\n3.标准间/夜300元\n4.总统套房/夜600元\n");
scanf("%d",&b);
switch(b)
{ case 1:printf("请输入预定天数\n");
scanf("%d",&x);
printf("请预交款为%d元\n",x*150);
printf("1.确定 2.返回");
scanf("%d",&h);
printf("您已预定成功★房间号码为202.\n");break;
case 2:printf("请输入预定天数\n");
scanf("%d",&x);
printf("请预交款为%d元\n",x*200);
printf("1.确定 2.返回");
scanf("%d",&h);
printf("您已预定成功★房间号码为305.\n");break;
case 3:printf("请输入预定天数\n");
scanf("%d",&x);
printf("请预交款为%d元\n",x*300);
printf("1.确定 2.返回");
scanf("%d",&h);
printf("您已预定成功★房间号码为208.\n");break;
case 4:printf("请输入预定天数\n");
scanf("%d",&x);
printf("请预交款为%d元\n",x*600);
printf("1.确定 2.返回");
scanf("%d",&h);
printf("您已预定成功★房间号码为306.\n");break;


default :printf("您的输入有错请您重试");
}
}break;
case 2:
{printf("请您输入您的身份证号码\n");
scanf("%d",&d[15]);
printf("您已登陆成功^-^\n");
printf("请您选择预订服务种类:\n");
printf("1.单人间/夜150元\n2.双人间/夜200元\n3.标准间/夜300元\n4.总统套房/夜600元\n");
scanf("%d",&c);
switch(c)
{case 1:printf("请您输入要退定的房间号码\n");
scanf("%d",&g[3]);
printf("请您输入要退订的天数\n");
scanf("%d",&y);
printf("我们将退您%d元\n",y*150);
printf("您退定成功: 谢谢您的光临 !\n");break;
case 2:printf("请您输入要退定的房间号码\n");
scanf("%d",&g[3]);
printf("请您输入要退订的天数\n");
scanf("%d",&y);
printf("我们将退您%d元\n",y*200);
printf("您退定成功.谢谢您的光临 !");break;
case 3:printf("请您输入要退定的房间号码\n");
scanf("%d",&g[3]);
printf("请您输入要退订的天数\n");
scanf("%d",&y);
printf("我们将退您%d元\n",y*300);
printf("您退定成功:谢谢您的光临 !\n");break;
case 4:printf("请您输入要退定的房间号码\n");
scanf("%d",&g[3]);
printf("请您输入要退订的天数\n");
scanf("%d",&y);
printf("我们将退您%d元\n",y*600);
printf("您退定成功:谢谢您的光临 !\n");break;
default:printf("您的输入有错请您重试");}

}break;}


{
int n;
printf("谢谢光顾\n是否要再预定? 1.是2.否");
scanf("%d",&n);
if(n==1)
search();
else
printf("再见");
}
}



这是一个酒店管理信息的程序,可能有点烂,不过对我来说足够了,不过我想加入一项“输入客户姓名”的选项,我自己加了很多遍,加不进去;
高手帮忙解答!!谢谢
要改的地方我标出来了
搜索更多相关主题的帖子: 解答 
2010-06-23 14:23
zhujianiu
Rank: 4
等 级:业余侠客
帖 子:126
专家分:244
注 册:2010-5-14
收藏
得分:2 
。。。 我觉得用线性表可能会好很多!
2010-06-23 14:27
F13
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2010-6-23
收藏
得分:0 
我是新手,这种程序我只能写到这种程度
2010-06-23 14:33
zhuywei
Rank: 1
等 级:新手上路
帖 子:2
专家分:2
注 册:2009-10-5
收藏
得分:2 
#include<stdio.h>
//void xx();
void search();
main()
{
    int f;
    printf(" ▲***********************▲\n");
    printf(" △ 欢迎来到XXX饭店△\n");
    printf(" ▲************************▲\n");
    printf("1.进入. 2退出.\n");
    scanf("%d",&f);
    if(f==1)
    search();
    else
    printf("输入错误");
}

void search()
{
    char name[15];
    int d[15],g[3],a,b,c,x,y,h;
    printf("请选择您需要的号码:\n1.预定房间\n2.退定房间\n");
    scanf("%d",&a);
    if(a>3 || a<1)
    {
        printf("您输入有误请您重试!\n");
    }

    else switch(a)                                 
    {
        case 1:               
        {
            printf("请您输入您的姓名\n");
            scanf("%s",name);

            printf("请您输入您的身份证号码\n"); //                         {我想在这个之前加个“输入姓名”;我总是加错,高手帮忙}
            scanf("%d",&d[15]);
            printf("您已登陆成功^-^\n");
            printf("请您选择yuding种类:\n");
            printf("5.单人间/夜150元\n6.双人间/夜200元\n3.标准间/夜300元\n4.总统套房/夜600元\n");
            scanf("%d",&b);
            switch(b)
            {
                case 5:
                    printf("请输入预定天数\n");
                    scanf("%d",&x);
                    printf("请预交款为%d元\n",x*150);
                    printf("1.确定 2.返回");
                    scanf("%d",&h);
                    printf("您已预定成功★房间号码为202.\n");
                    break;
               
                case 6:
                    printf("请输入预定天数\n");
                    scanf("%d",&x);
                    printf("请预交款为%d元\n",x*200);
                    printf("1.确定 2.返回");
                    scanf("%d",&h);
                    printf("您已预定成功★房间号码为305.\n");
                    break;

                case 3:
                    printf("请输入预定天数\n");
                    scanf("%d",&x);
                    printf("请预交款为%d元\n",x*300);
                    printf("1.确定 2.返回");
                    scanf("%d",&h);
                    printf("您已预定成功★房间号码为208.\n");
                break;

                case 4:
                    printf("请输入预定天数\n");
                    scanf("%d",&x);
                    printf("请预交款为%d元\n",x*600);
                    printf("1.确定 2.返回");
                    scanf("%d",&h);
                    printf("您已预定成功★房间号码为306.\n");
                    break;


                default :
                    printf("您的输入有错请您重试");
            }
        }
        break;

        case 2:
        {
            printf("请您输入您的身份证号码\n"); //                         {我想在这个之前加个“输入姓名”;我总是加错,高手帮忙}
            scanf("%d",&d[15]);
            printf("您已登陆成功^-^\n");
            printf("请您选择tuiding种类:\n");
            printf("5.单人间/夜150元\n6.双人间/夜200元\n3.标准间/夜300元\n4.总统套房/夜600元\n");
            scanf("%d",&b);  
            
            {
                case 5:
                    printf("请您输入要退定的房间号码\n");
                    scanf("%d",&g[3]);
                    printf("请您输入要退订的天数\n");
                    scanf("%d",&y);
                    printf("我们将退您%d元\n",y*150);
                    printf("您退定成功: 谢谢您的光临 !\n");
                break;

                case 6:
                    printf("请您输入要退定的房间号码\n");
                    scanf("%d",&g[3]);
                    printf("请您输入要退订的天数\n");
                    scanf("%d",&y);
                    printf("我们将退您%d元\n",y*200);
                    printf("您退定成功.谢谢您的光临 !");
                break;

                case 3:
                    printf("请您输入要退定的房间号码\n");
                    scanf("%d",&g[3]);
                    printf("请您输入要退订的天数\n");
                    scanf("%d",&y);
                    printf("我们将退您%d元\n",y*300);
                    printf("您退定成功:谢谢您的光临 !\n");
                break;

                case 4:
                    printf("请您输入要退定的房间号码\n");
                    scanf("%d",&g[3]);
                    printf("请您输入要退订的天数\n");
                    scanf("%d",&y);
                    printf("我们将退您%d元\n",y*600);
                    printf("您退定成功:谢谢您的光临 !\n");
                    break;

                default:printf("您的输入有错请您重试");}

                }
        break;
    }

    int n;
    printf("谢谢光顾\n是否要再预定? 1.是2.否");
    scanf("%d",&n);
    if(n==1)
        search();
    else
    printf("再见");
}
2010-06-23 15:19
快速回复:如何往这里加点东西!高手帮忙解答
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.024616 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved