iPhone随机数
求随机数的三种方法:
1. srand((unsigned)time(0));
int i = rand() % 5;
2. srandom(time(0));
int i = random() % 5;
3. int i = arc4random() % 5 (常用) ;
参考:
http://www.cocoachina.com/bbs/read.php?tid=70719&keyword=%CB%E6%BB%FA%CA%FD
http://www.cocoachina.com/bbs/read.php?tid-2977-fpage-2-toread--page-1.html
http://www.codeios.com/thread-310-1-1.html