flybirding10011 2021-07-03 11:05 采纳率: 51.9%
浏览 8
已结题

代码块末尾有空行会出现 {1},这是怎么回事呀?

#include <stdio.h>
#include <string.h>
#include <time.h>
#include <stdlib.h>
#include <process.h>

//汽车租赁
void UseCar(struct UseInfo useinfo[],int nmbInfo,class Guest* guest[],int *nmbGuest)
{
    char name[20]={0};
    char id[20]={0};
    char phone[20]={0};
    int type;
    int mode;
    Guest* gu = 0;
    Car* pcar = 0;
    ECarType eCar;
    //EUseType eUse;
    int index = 0;
    int y,m,d;
    system("cls");
    printf("请输入租车人的编号:");
    scanf("%s",id);
    printf("请输入租车人的姓名:") ;
    scanf("%s",name);
    printf("请输入租车人的电话:");
    scanf("%s",phone);
    gu = isExist(id,guest,*nmbGuest);
    if(gu == 0)
    {
        gu = new Guest(id,name,phone);
        guest[*nmbGuest] = gu;
        *nmbGuest = *nmbGuest + 1;
    }
    //
    printf("请输入租车类型:1.轿车 2.客车:");
    scanf("%d",&type);
    //printf("请输入租车方式:1.日租 2.月租 3.年租:");
    //scanf("%d",&mode);
    printf("请输入起租日期:");
    scanf("%d %d %d",&y,&m,&d);
    if(type == 1)
        eCar = e_car_jc;
    else
        eCar = e_car_kc;
    /*if(mode == 1)
    eUse = e_use_day;
    else if(mode == 2)
    eUse = e_use_month;
    else
    eUse = e_use_year;*/
    pcar = getUsefullCar(useinfo,nmbInfo,eCar,&index);
    if(pcar == 0)
        printf("当前已无该类型的车辆可以出租\n");
    else
    {
        useinfo[index].guest = gu;
        /*if(1==mode)
        useinfo[index].type = e_use_day;
        else if(2== mode)
        useinfo[index].type = e_use_month;
        else
        useinfo[index].type = e_use_year;*/
        useinfo[index].date.year = y;
        useinfo[index].date.month = m;
        useinfo[index].date.day = d;
        printf("租车成功,车辆编号:%s\n",pcar->getId());
    }
    system("pause");
}
//汽车信息查询
void FindCar(struct UseInfo useinfo[],int nmbInfo)
{
    char id[20]={0};
    int type;
    int opt,i;
    int isfind ;
    int bgo = 1;
    char ch;
    while(bgo)
    {
        system("cls");
        printf("1.根据编号查询\n");
        printf("2.根据类型查询\n");
        printf("3.查询已出租车辆\n");
        printf("4.查询未出租车辆\n");
        printf("5.显示全部车辆\n");
        scanf("%d",&opt);
        switch(opt)
        {
        case 1:
            printf("请输入编号");
            scanf("%s",id);
            for (i=0;i<nmbInfo;i++)
            {
                if (strcmp(id,useinfo[i].pCar->getId()) == 0)
                {
                    useinfo[i].show();
                    break;
                }
            }
            if(i == nmbInfo)
                printf("未找到编号为%s的车辆\n",id);
            break;
        case 2:
            printf("请输入类型(1.轿车 2.客车):");
            scanf("%d",&type);
            isfind = 0;
            for (i=0;i<nmbInfo;i++)
            {
                if ( useinfo[i].pCar->getType() == type)
                {
                    useinfo[i].show();
                    isfind = 1;
                }
            }
            if(0== isfind)
                printf("未找到该类型的车辆\n");
            break;
        case 3:
            isfind = 0;
            for (i=0;i<nmbInfo;i++)
            {
                if ( useinfo[i].guest != 0)
                {
                    useinfo[i].show();
                    isfind = 1;
                }
            }
            if(0== isfind)
                printf("未找到符合要求的车辆\n");
            break;
        case 4:
            isfind = 0;
            for (i=0;i<nmbInfo;i++)
            {
                if ( useinfo[i].guest == 0)
                {
                    useinfo[i].show();
                    isfind = 1;
                }
            }
            if(0== isfind)
                printf("未找到符合要求的车辆\n");
            break;
        case 5:
            for (i=0;i<nmbInfo;i++)
            {
                useinfo[i].show();
            }
            break;
        }
        printf("是否继续查询(Y/N)?");
        while(1)
        {
            scanf(" %c",&ch);
            getchar();
            if(ch == 'y' || ch == 'Y')
                break;
            else if(ch =='n'||ch == 'N')
            {
                bgo = false;
                break;
            }
        }
    }
    system("pause");
}
//查询用户信息
void FindUser(struct UseInfo useinfo[],int nmbInfo,class Guest* guest[],int nmbGueset)
{
    char tmp[20]={0};
    int i;
    int bgo = 1;
    int bfind = 0;
    Guest* pguest = 0;
    char ch;
    while(bgo)
    {
        system("cls");
        memset(tmp,0,20);
        bfind = 0;
        printf("请输入需要查询的用户编号或者姓名或者电话:");
        scanf("%s",tmp);
        pguest = 0;
        for (i=0;i<nmbGueset;i++)
        {
            if (strcmp(guest[i]->getId(),tmp)==0 || strcmp(guest[i]->getName(),tmp)==0 || strcmp(guest[i]->getPhone(),tmp)==0  )
            {
                pguest = guest[i];
            }
        }
        if (pguest == 0)
        {
            printf("未找到该用户\n");
        }else
        {
            printf("用户编号:%s\n",pguest->getId());
            printf("用户姓名:%s\n",pguest->getName());
            printf("用户电话:%s\n",pguest->getPhone());
            for (i=0;i<nmbInfo;i++)
            {
                if(useinfo[i].guest == pguest )
                {
                    useinfo[i].show();
                    break;
                }
            }
        }
        printf("是否继续查询(y/n)?");
        while(1)
        {
            scanf(" %c",&ch);
            getchar();
            if(ch == 'y' || ch == 'Y')
                break;
            else if(ch =='n'||ch == 'N')
            {
                bgo = false;
                break;
            }
        }
    }
}
{1}




  • 写回答

1条回答 默认 最新

  • flybirding10011 测试 2021-07-13 19:06
    关注

    将URL用EL表达式展示到 iframe的src属性即可打开这个页面,后台使用request封装url

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 9月30日
  • 已采纳回答 9月22日

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效