练习

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

 

 

转载于:https://www.cnblogs.com/yuyingming/p/4923780.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值