C#入门小程序 猜数字
最新推荐文章于 2021-10-24 17:13:31 发布
小白刚起步,变得不好,见谅。
static void Main(string[] args){
Random r = new Random();
int n = r.Next(100,1000);
int m;
do{
console.Write("输入一个数:");
m = int.Parse(Console.ReadLine());
if(m>n)
Console.WriteLine("大了");
if(m<n)
Console.WriteLine("小了");
}
While(m!=n);
Console.WriteLine("答对了")
Console.ReadLine();
}