Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
简而言之,我正在寻找一种简洁的算法,用于在 C 中生成 sudorandom 数,我可以将其分配为整数值。我还希望能够为生成分配最大值限制。
这是一个有用的功能,你可以使用我做的!
int getRandomNumber(int max) { Random r = new Random(); int number = r.Next(0, max); return number; }