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.
我有这个代码
label1.Caption:= 'Number is:' + inttostr(random(2) + 1);
但结果我每次都有“1”。你能解释一下我做错了什么吗?
要初始化随机数生成器,您必须Randomize在使用 random 函数之前调用方法。
Randomize