社区
C语言
帖子详情
why??????
lhgyes
2000-08-29 04:34:00
srand()是何用?
...全文
109
3
打赏
收藏
why??????
srand()是何用?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
3 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
hoyle
2000-08-30
打赏
举报
回复
srand是使用用户的参数作为种子来产生伪随机数的一个函数
种子的选取影响到随机数的产生
srand 和random的区别在于,random不需要由用户指定种子,所以
如果在使用random 之前没有执行randomize,那么random每次产生的随机数序列都是一样的
hoyle
2000-08-30
打赏
举报
回复
srand是使用用户的参数作为种子来产生伪随机数的一个函数
种子的选取影响到随机数的产生
huntout
2000-08-29
打赏
举报
回复
Sets a random starting point.
Example
/* RAND.C: This program seeds the random-number generator
* with the time, then displays 10 random integers.
*/
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
void main( void )
{
int i;
/* Seed the random-number generator with current time so that
* the numbers will be different every time we run.
*/
srand( (unsigned)time( NULL ) );
/* Display 10 numbers. */
for( i = 0; i < 10;i++ )
printf( " %6d\n", rand() );
}
Why!?
Why!?
Scarcity: Why Having Too Little Means So Much
稀缺:为什么拥有太少后果会很严重?Why do successful people get things done at the last minute? Why does poverty persist? Why do organizations get stuck firefighting? Why do the lonely find it hard to make friends? These questions seem unconnected, yet Sendhil Mullainathan and Eldar Shafir show that they are all examples of a mind-set produced by scarcity.
Ethernet AVB
What is AVB? Why is it need? Where will it be used? How does it work?
精简版的MSDN for VB6.0
MSDN VB6精简版 ,去除了MSDN中VC。 VF以及其他部分,只保留了完整的VB帮助,强烈推荐! ========= 安装说明 ========= 1、执行setup.exe。 2、注册码已固化在安装程序里,不必输入了。^*^ 3、按照提示点击鼠标就完事OK。(不要使用键盘) !!!本安装可能会与新版MSDN冲突,如果您有新版MSDN,就别安装本文件!!! ========= Why this? ========= 喜欢用 Visual Basic 6? 我也是。 感觉MSDN太大? 我也是。 这是thriller精心简化的VB6.1中文版MSDN帮助。 而这么好的东西有多大?区区14MB! 在开玩笑吗? 一点没开玩笑。 这是thriller精心简化的VB6中文版MSDN帮助。 thriller的目的在于让大家都来学用VB,所以花这么大力气。 所以请大家珍惜,不要骂。 另外,M$既然不再支持VB6,thriller替他们支持吧。 注意!不可以用于商业和赢利环境,你非要用于商业和赢利环境我也没办法^x^。
why?why?why?
我得原博客 http://www.cnblogs.com/lan0725 为什么我从别的博客导入的文章都是今天的时间而不是当时的文章发布时间?你不觉得这个很恶心吗?
C语言
69,372
社区成员
243,080
社区内容
发帖
与我相关
我的任务
C语言
C语言相关问题讨论
复制链接
扫一扫
分享
社区描述
C语言相关问题讨论
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章