Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2349472
  • 博文数量: 816
  • 博客积分: 10000
  • 博客等级: 上将
  • 技术积分: 5010
  • 用 户 组: 普通用户
  • 注册时间: 2008-12-17 17:57
文章分类

全部博文(816)

文章存档

2011年(1)

2008年(815)

分类:

2008-12-17 18:08:22

#include
void main()
{
    int  y;
   
    printf("请问购物吗?是请输1:不是请输0\n");
    scanf("%d",&y);
   
    if (y==1)
    {
        printf("请问是活动期吗?是请输1:不是请输0\n");
        scanf("%c",&y);

        if (y==1)
        {
           printf("请问是A类会员吗?是请输1:不是请输0\n");
           scanf("%c",&y);
           
           if (y==1)
           {
              printf("请问购物500元以上吗?是请输1:不是请输0\n");
              scanf("%c",&y);
             
              if (y==1)
              {
                  printf("打6.5折\n");
                 
              }
              else
              {
                  printf("请问购物100元以上吗?是请输1:不是请输0\n");
                  scanf("%c",&y);
                 
                  if (y==1)
                  {
                      printf("打7.5折\n");
                       
                  }
                  else
                  {
                      printf("打8折\n");
                     
                  }
              }
           }

           else
           {
               printf("请问是B类会员吗?是请输1:不是请输0\n");
               scanf("%c",&y);

               if (y==1)
               {  
                   printf("请问购物500元以上吗?是请输1:不是请输0\n");
                   scanf("%c",&y);

                   if (y==1)
                   {
                       printf("打5折\n");
                       
                   }
                   else
                   {
                       printf("请问购物100元以上吗?是请输1:不是请输0\n");
                       scanf("%c",&y);
                       
                       if (y==1)
                       {
                           printf("打6折\n");
                           
                       }
                       else
                       {
                           printf("打7折\n");
                           
                       }
                     
                   }
               }

               else
               {
                    printf("请问是C类会员吗?是请输1:不是请输0\n");
                    scanf("%c",&y);

                    if(y==1)
                    {
                        printf("打6.5折\n");
                         
                    }
                    else
                    {
                        printf("原价支付\n");
                         
                    }

               }

           }
        }
        else
        {
            printf("请问是A类会员吗?是请输1:不是请输0\n");
            scanf("%c",&y);

            if (y==1)
            {
                printf("打8折\n");

            }
            else
            {    
                printf("请问是B类会员吗?是请输1:不是请输0\n");
                scanf("%c",&y);
               
                if (y==1)
                {
                        printf("打7.5折\n");
                }
                else
                {
                    printf("请问是C类会员吗?是请输1:不是请输0\n");
                    scanf("%c",&y);

                    if (y==1)
                    {
                            printf("打6.5折\n");
                       
                    }
                    else
                    {
                        printf("请问购物超过500元吗?是请输1:不是请输0\n");
                        scanf("%c",&y);

                        if (y==1)
                        {    
                            printf("打9折\n");
                                printf("发a卡\n");
                        }
                        else
                        {
                            printf("请问购物超过200元吗?是请输1:不是请输0\n");
                            scanf("%c",&y);

                            if (y==1)
                            {
                                printf("打9.5折\n");
                            }
                            else
                            {
                                printf("原价支付\n");    
                            }

                   

--------------------next---------------------
程序没错,只是括号没有匹配好
修改如下.

#include
void main()
{
    int  y;
   
    printf("请问购物吗?是请输1:不是请输0\n");
    scanf("%d",&y);
   
    if (y==1)
    {
        printf("请问是活动期吗?是请输1:不是请输0\n");
        scanf("%c",&y);

        if (y==1)
        {
           printf("请问是A类会员吗?是请输1:不是请输0\n");
           scanf("%c",&y);
           
           if (y==1)
           {
              printf("请问购物500元以上吗?是请输1:不是请输0\n");
              scanf("%c",&y);
             
              if (y==1)  printf("打6.5折\n");
  else
              {
                  printf("请问购物100元以上吗?是请输1:不是请输0\n");
                  scanf("%c",&y);
                 
                  if (y==1)      printf("打7.5折\n");
                       
                   else
                 
                     printf("打8折\n");
                                }
}}


           else
           {
               printf("请问是B类会员吗?是请输1:不是请输0\n");
               scanf("%c",&y);

               if (y==1)
               {  
                   printf("请问购物500元以上吗?是请输1:不是请输0\n");
                   scanf("%c",&y);

                   if (y==1)
                   {
                       printf("打5折\n");
                       
                   }
                   else
                   {
                       printf("请问购物100元以上吗?是请输1:不是请输0\n");
                       scanf("%c",&y);
                       
                       if (y==1)
                       {
                           printf("打6折\n");
                           
                       }
                       else
                       {
                           printf("打7折\n");
                           
                       }
                     
                   }
               }

               else
               {
                    printf("请问是C类会员吗?是请输1:不是请输0\n");
                    scanf("%c",&y);

                    if(y==1)
                    {
                        printf("打6.5折\n");
                         
                    }
                    else
                    {
                        printf("原价支付\n");
                         
                    }

               }

           }
        }
        else
        {
            printf("请问是A类会员吗?是请输1:不是请输0\n");
            scanf("%c",&y);

            if (y==1)          
                printf("打8折\n");

                 else
            {    
                printf("请问是B类会员吗?是请输1:不是请输0\n");
                scanf("%c",&y);
               
                if (y==1)
                     printf("打7.5折\n");
               
                else
                {
                    printf("请问是C类会员吗?是请输1:不是请输0\n");
                    scanf("%c",&y);

                    if (y==1)
                 
                            printf("打6.5折\n");
                     
                    else
                    {
                        printf("请问购物超过500元吗?是请输1:不是请输0\n");
                        scanf("%c",&y);

                        if (y==1)
                        {    
                            printf("打9折\n");
                                printf("发a卡\n");
                        }
                        else
                        {
                            printf("请问购物超过200元吗?是请输1:不是请输0\n");
                            scanf("%c",&y);

                            if (y==1)
                           
                                printf("打9.5折\n");
                         
                            else
                         
                                printf("原价支付\n");    
                            }
           }
      }
             }
         }
}

--------------------next---------------------

阅读(1440) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~