利用if else咱们结婚吧


    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                string a;
                Console.WriteLine("请问你有房吗:");
                a = Console.ReadLine();
                if (a == "有")
                {
                    Console.WriteLine("请问你有车吗:");
                    a = Console.ReadLine();
                    if (a == "有")
                    {
                        Console.WriteLine("请问你有钱吗:");
                        a = Console.ReadLine();
                        if (a == "有")
                        {
                            Console.WriteLine("结婚吧");
                        }
                        else
                        {
                            Console.WriteLine("没钱吃什么");
                        }
                    }
                    else
                    {
                        Console.WriteLine("没车你来干什么");
                    }

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

 

 

 

 

 

 

 

                Console.ReadLine();
            }
        }
    }
}

posted @ 2015-03-29 13:56  XCml  阅读(122)  评论(0编辑  收藏  举报