zoukankan      html  css  js  c++  java
  • 练习

    Console.WriteLine("你有房吗?");

                string a = Console.ReadLine();

            

                if (a=="有")

                {

                    Console.WriteLine("结婚吧");

                }

                else if (a == "没有")

               

                {

                    Console.WriteLine("你有钱吗?");

                    string b = Console.ReadLine();

                    if (b == "有")

                    {

                        Console.WriteLine("先买房再结婚");

                    }

                    else if (b == "没有")

                    {

                        Console.WriteLine("你有能力吗?");

                    }

                    else

                    {

                        Console.WriteLine("你输入有误");

                    }

                       

                    string c = Console.ReadLine();

                    if (c == "有")

                    {

                        Console.WriteLine("先赚钱在买房 在结婚");

                    }

                    else if (c == "没有")

                    {

                        Console.WriteLine("拜拜");

                    }

     

                }

                else

                {

                    Console.WriteLine("你输入有误");

                }

                }

     

    Console.Write("请输入现在的时间:");

                int shi = int.Parse(Console.ReadLine());

                string str=(shi>12)?"am":"pm";

                //时间大于12 的减去12,一定要在判断玩上午或者下午后

                shi = (shi>12)?

                 Console.WriteLine("现在是"+str+shi+"点");

     

     

     

    Console.WriteLine("请输入一个整数:");

    int b = int.Parse(Console.ReadLine());

                Console.WriteLine("请输入一个整数:");

                int c= int.Parse(Console.ReadLine());

               int min=(a<b&&a<c)?a:b;

               min=(b<a&&b<c)?b:min;

                min=(c<b&&c<a)?c:min;

     

                int max=(a>b&&a>c)?a:b;

                max=(b>a&&b>c)?b:max;

                max=(c>b&&c>a)?c:max;

     

     

                int mid = (min==a && max==c) ? b : a;

                mid = (min == a && max ==b) ? c:mid;

                mid = (min == b && max == c) ? a : mid;

                mid = (min == b&& max == a) ? c : mid;

                mid = (min == c && max == a) ? b : mid;

                mid = (min == c && max == b) ?a : mid;

     

                Console.WriteLine(min+""+mid+""+max);

                Console.ReadLine();

     

     

  • 相关阅读:
    浅谈数据的离散化
    【ZOJ】3785 What day is that day? ——浅谈KMP在ACM竞赛中的暴力打表找规律中的应用
    【Python】iichats —— 命令行下的局域网聊天程序
    【Python】iiblogs ——命令行下的网页收藏夹
    【Python】iiacm_filemaker ——简易的.cpp文件创建即初始化脚本,ACMer专用
    【黑科技】读写优化
    【POJ】1330 Nearest Common Ancestors ——最近公共祖先(LCA)
    【HDU】1717 小数化分数2 ——计数原理
    【POJ】2318 TOYS ——计算几何+二分
    【HDU】4923 Room and Moor(2014多校第六场1003)
  • 原文地址:https://www.cnblogs.com/yuyingming/p/4923780.html
Copyright © 2011-2022 走看看