zoukankan      html  css  js  c++  java
  • 利用if else来运行咱们结婚吧


            static void Main(string[] args)
            {
                while (true)
                {
                    string a;
                    Console.WriteLine("请问你有房吗:");
                    a = Console.ReadLine();
                    if (a == "有")
                    {
                        Console.WriteLine("请问你有车吗:");
                        a = Console.ReadLine();
                        if (a == "有")
                        {                                                                              //主要运动if else的嵌套。。 注意嵌套的if else 要一块打,不然会很难分清;
                            Console.WriteLine("请问你有钱吗:");
                            a = Console.ReadLine();
                            if (a == "有")
                            {
                                Console.WriteLine("结婚吧");
                            }
                            else
                            {
                                Console.WriteLine("没钱吃什么");
                            }
                        }
                        else
                        {
                            Console.WriteLine("没车你来干什么");
                        }

                    }
                    else
                    {
                        Console.WriteLine("房子都没有住大街上吗");
                    }

  • 相关阅读:
    POJ 2240 Arbitrage spfa 判正环
    POJ 3259 Wormholes spfa 判负环
    POJ1680 Currency Exchange SPFA判正环
    HDU5649 DZY Loves Sorting 线段树
    HDU 5648 DZY Loves Math 暴力打表
    HDU5647 DZY Loves Connecting 树形DP
    CDOJ 1071 秋实大哥下棋 线段树
    HDU5046 Airport dancing links 重复覆盖+二分
    HDU 3335 Divisibility dancing links 重复覆盖
    FZU1686 神龙的难题 dancing links 重复覆盖
  • 原文地址:https://www.cnblogs.com/lk-kk/p/4374262.html
Copyright © 2011-2022 走看看