首页 > 其他 > 详细

IF的使用

时间:2015-11-20 06:57:48      阅读:278      评论:0      收藏:0      [点我收藏+]

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 第四个程序
{
  class Program
  {
    static void Main(string[] args)
    {

      Console.WriteLine("请输入密码");
      string password = Console.ReadLine();
      if (password == "888")
        {
          Console.WriteLine("密码正确");
        }
      else
        {
          Console.WriteLine("请重新输入");
          password = Console.ReadLine();
          if (password == "888")
          {
            Console.WriteLine("密码正确");
          }
          else
          {
            Console.WriteLine("程序错误");
          }
        }
      Console.WriteLine("程序结束");
      Console.ReadKey();

    }
  }
}

 

运行效果:

技术分享

IF的使用

原文:http://www.cnblogs.com/start-from-scratch/p/4979647.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!