waiting...'s Blog
Happy coding
首页
撰写
留言板
管理
waiting...
C/C++
默认分类
最新评论
jenni : Hello, I ...
Andrew Strauch : ...
joker123 : Does o...
Andrew Strauch : ...
Andrew Strauch : ...
最新留言
LeropdvinnA : 1xB...
LeropdvinnA : 1xB...
LeropdvinnA : How...
Minyanes : <a hre...
caseycp1 : Enjoy ...
链接
功能
注册
登录
忘记密码?
文章 RSS
评论 RSS
留言 RSS
waiting...'s Blog
产生介于某一返回的随机数的函数
// 返回一个介于lower与upper之间的随机数
#include <cstdlib>
int
rand_int
(
int
lower,
int
upper
)
{
return
lower +
rand
(
)
%
(
upper - lower +
1
)
;
}
C/C++
返回
随机数
函数
上限
下限
上下限
范围
Comments(0)
2009年3月02日 22:47