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();

     

     

  • 相关阅读:
    Linux0.11内核--fork进程分析
    Linux0.11内核--内存管理之1.初始化
    Linux0.11内核--进程调度分析之2.调度
    Linux0.11内核--进程调度分析之1.初始化
    github
    推荐大家一个靠谱的论文检测平台。重复的部分有详细出处以及具体修改意见,能直接在文章上做修改,全部改完一键下载就搞定了。他们现在正在做毕业季活动, 赠送很多免费字数,可以说是十分划算了!地址是:https://www.paperpass.com/
    妈妈再也不用担心我找idea激活码了
    eclipse集成tomcat
    DNS--localhost
    RFC 2819)第5节"Definitions"除外的全部内容
  • 原文地址:https://www.cnblogs.com/yuyingming/p/4923780.html
Copyright © 2011-2022 走看看