zoukankan      html  css  js  c++  java
  • c# 结婚例子

    Console.Title = "结婚例子";
    bool a, b, c;
    string y;
    Console.WriteLine("有房?(Y/N)");
    y = Console.ReadLine();

    a = Convert.ToBoolean((y == "y" || y == "Y") ? 1 : 0);

    Console.WriteLine("有车?(Y/N)");
    y = Console.ReadLine();
    b = Convert.ToBoolean((y == "y" || y == "Y") ? 1 : 0);

    Console.WriteLine("有钱?(Y/N)");
    y = Console.ReadLine();
    c = Convert.ToBoolean((y == "y" || y == "Y") ? 1 : 0);
    if (a&b&c)
    {
    Console.WriteLine("可以继续了解");
    }
    else if(a&b)
    {
    Console.WriteLine("等有钱了再说吧");
    }

    else if (a&c)
    {
    Console.WriteLine("等你有车再说吧");
    }
    else if (b&c)
    {
    Console.WriteLine("等你房再说吧");
    }
    else if (a)
    {
    Console.WriteLine("等你有车有钱再说吧");
    }
    else if (b)
    {
    Console.WriteLine("等你有房有钱再说吧");
    }
    else if (c)
    {
    Console.WriteLine("等你有房有车再说吧");
    }
    else
    {
    Console.WriteLine("等你有房有车有钱再说吧");
    }

  • 相关阅读:
    /sbin/nologin 和 /bin/false 的区别
    lesson
    df 命令详解
    课后习题-7 阶段汇总
    javascript Window Navigator
    javascript 正则表达式
    linux crontab 的使用
    linux环境变量
    linux第一个C语言和sh脚本
    linux 文件常用操作
  • 原文地址:https://www.cnblogs.com/lovesy2413/p/4309536.html
Copyright © 2011-2022 走看看