取值范围:
[0 , x - 1]
NSInteger random = arc4random_uniform(x);
[1 , x]
NSInteger random = arc4random_uniform(x) + 1;
0 或 1
NSInteger random = arc4random_uniform(2);
取值范围:
[0 , x - 1]
NSInteger random = arc4random_uniform(x);
[1 , x]
NSInteger random = arc4random_uniform(x) + 1;
0 或 1
NSInteger random = arc4random_uniform(2);
本文标题:随机数
本文链接:https://www.haomeiwen.com/subject/tdtixftx.html
网友评论