//练习:输入用户名密码,使用While,如果输错,提示再次输入,直到正确
using System;
using System.Collections.Generic;
using System.Text;
namespace 练习
{
class Program
{
static void Main(string[] args)
{
string username = Console.ReadLine();
string password = Console.ReadLine();
while (username != "zhangjie" && password != "123456")
{
Console.WriteLine("你输入的用户名和密码不正确,请重输");
username = Console.ReadLine();
password = Console.ReadLine();
}
}
}
}
阅读(511) | 评论(0) | 转发(0) |