zoukankan      html  css  js  c++  java
  • 第八章:if-else语句

    if-else语句:if是如果的意思,else是其他情况的意思

    代码:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    //if如果的意思,else是其他情况的意思
    
    namespace if_else语句
    {
        class Program
        {
    
    
            static void Main(string[] args)
            {
                string hello = "123";
                if (hello == "上午")
                {
                    //写我们想要打印的语句
                    Console.WriteLine("早上好!");
                }
                else if (hello == "中午")
                {
                    Console.WriteLine("中午好!");
                }
                else if (hello == "晚上")
                {
                    Console.WriteLine("晚上好!");
                }
                else
                {
                    Console.WriteLine("休息中");
                }
                Console.Read();
            }
        }
    }

    运行结果:

  • 相关阅读:
    毕设(五)ListView
    毕设(四)ListBox
    毕设(三)NotifyIcon
    hdu 1.2.3
    ZOJ 1789 The Suspects
    ZOJ 2833 Friendship
    git
    yum wget rpm
    上传绕过
    LAMP 和 LNMP
  • 原文地址:https://www.cnblogs.com/wangqiangya/p/13045212.html
Copyright © 2011-2022 走看看