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 中定义数字 3,4?它是随机选择的吗?
尝试这个:
int r = 3 + arc4random() % 2;
arc4random() % 2随机返回 0 或 1。添加 3 将使其在 3 和 4 之间随机选择。
arc4random() % 2