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 }

    运行效果:

  • 相关阅读:
    货币系统
    纸牌
    活动
    KKT-黑白球
    POJ2676-Sudoku
    POJ1717-Dominoes
    POJ1088-滑雪
    POJ1862-Stripies
    POJ2531-Network Saboteur
    2019.12.13 数的划分
  • 原文地址:https://www.cnblogs.com/start-from-scratch/p/4979647.html
Copyright © 2011-2022 走看看