7,765
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.IO;
namespace Shen7
{
class Shen7
{
static void Main(string[] args)
{
//args[0] 为神七点火发射的时间, 以 年+月+日+时+分+秒
//args[1] 为本帖楼数.
//随机种子数为 上面两数相差
//所以输出是一定的.就是中奖楼数!!!!!!!!!!!!!!!!
DateTime d = Convert.ToDateTime(args[0]);
int i = d.Year + d.Month + d.Day + d.Hour + d.Minute + d.Second;
int j = int.Parse(args[1]);
Random r = new Random(i*j);
Console.WriteLine("{0}", r.Next(1, j + 1));
Console.Read();
}
}
}