📄 math.cpp
字号:
#include "Math.h"
#include <cmath>
#include <ctime>
#include <cstdlib>
////////////////////////////////////////////
static class RandInit
{
public:
RandInit(void)
{
time_t t;
time(&t);
srand((unsigned int)t);
}
} afxRandInit;
////////////////////////////////////////////
int _tool::RandInt(void)
{
return rand();
}
////////////////////////////////////////////
int _tool::RandInt(unsigned int max)
{
return rand() % max;
}
////////////////////////////////////////////
double _tool::RandDouble(double max)
{
return max * rand() / RAND_MAX;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -