randomnumgenerator.cpp
来自「扑克牌比大比小用c++语言实现」· C++ 代码 · 共 19 行
CPP
19 行
// RandomNumGenerator.cpp: implementation of the RandomNumGenerator class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "RandomNumGenerator.h"
#include<ctime>
#include<cstdlib>
RandomNumGenerator::RandomNumGenerator()
{
srand(time(NULL));
}
int RandomNumGenerator::RandomNum(int limit)
{
return rand()%limit;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?