zoukankan      html  css  js  c++  java
  • IF的使用

     1 using System;
     2 using System.Collections.Generic;
     3 using System.Linq;
     4 using System.Text;
     5 using System.Threading.Tasks;
     6 
     7 namespace 第四个程序
     8 {
     9   class Program
    10   {
    11     static void Main(string[] args)
    12     {
    13 
    14       Console.WriteLine("请输入密码");
    15       string password = Console.ReadLine();
    16       if (password == "888")
    17         {
    18           Console.WriteLine("密码正确");
    19         }
    20       else
    21         {
    22           Console.WriteLine("请重新输入");
    23           password = Console.ReadLine();
    24           if (password == "888")
    25           {
    26             Console.WriteLine("密码正确");
    27           }
    28           else
    29           {
    30             Console.WriteLine("程序错误");
    31           }
    32         }
    33       Console.WriteLine("程序结束");
    34       Console.ReadKey();
    35 
    36     }
    37   }
    38 }

    运行效果:

  • 相关阅读:
    bug、兼容性、适配问题
    关于daterangepicker取消默认值的设置
    重构-改善既有代码设计
    iphoneX 适配
    汇编语言(2)程序表示
    汇编语言(1)基础理论
    css 边框颜色渐变的半圆
    横向时间轴(进度条)
    pdf中内嵌字体问题
    jabRef里引用的相邻同名作者变横线
  • 原文地址:https://www.cnblogs.com/start-from-scratch/p/4979647.html
Copyright © 2011-2022 走看看