cppclass rand_generator {
public:
rand_generator(int seed = 0)
: seed_{ seed } {}
operator int() {
seed_ = (seed_ * 214013 + 2531011) & 0x7fffffff;
return seed_;
}
private:
int seed_{};
};
本文作者:OhtoAi
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!