C#判断语句的问题
来源:百度知道 编辑:UC知道 时间:2024/05/30 18:27:18
我的程序,哥们儿看看吧!
using System;
using System.Collections.Generic;
using System.Text;
namespace 随机数
{
class Program
{
static void Main(string[] args)
{
int target = 5;
Random random = new Random();
int num = random.Next(1,10);
if (num == target) { Console.WriteLine("OK ! Find the Number "+target); }
else
{
do
{
Console.WriteLine("the Random Num is "+num);
num = random.Next(1, 10);
} while (num != target);
Console.WriteLine("OK ! Find the Number "+num);
}
}
}
}
int num;
do
{
Random r=new Random();
}while(r.Next()==num)
int target = 200;
Random random = new Ran