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

     

     

  • 相关阅读:
    mysql获取给定时间段内的所有日期列表
    mysql中的年,月,日统计以及日历表的实现
    MySQL5.7安装配置
    获取ip地址
    Intellij热部署插件JRebel
    IntelliJ IDEA2018版热部署jrebel插件安装使用教程
    idea插件篇之java内存分析工具(JProfiler)
    mysql中的整除,取余
    SIMD.mul (SIMD) – JavaScript 中文开发手册
    Java面试题 : 如何确保N个线程访问N个资源的同时又不导致死锁
  • 原文地址:https://www.cnblogs.com/yuyingming/p/4923780.html
Copyright © 2011-2022 走看看