VC如何使用rand

[复制链接]
查看11 | 回复2 | 2011-3-15 02:19:46 | 显示全部楼层 |阅读模式
// crt_rand.c/* This program seeds the random-number generator * with the time, then displays 10 random integers. */#include #include #include int main( void ){ int i; /* Seed the random-number generator with current time so that
* the numbers will be different every ...
回复

使用道具 举报

千问 | 2011-3-15 02:19:46 | 显示全部楼层
可以看看我的这个例子:#include #include #include void main( void ){ int i; srand( (unsigned)time( NULL ) );//这是一个种子,一定不要...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行