📄 fig10_55.cpp
字号:
static const int A = 48271;
static const int M = 2147483647;
static const int Q = M / A;
static const int R = M % A;
/**
* Return a pseudorandom int, and change the internal state.
*/
int Random::randomInt( )
{
int tmpState = A * ( state % Q ) - R * ( state / Q );
if( tmpState >= 0 )
state = tmpState;
else
state = tmpState + M;
return state;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -