Feat: lab 4
This commit is contained in:
12
kernel/lib/random.c
Normal file
12
kernel/lib/random.c
Normal file
@@ -0,0 +1,12 @@
|
||||
#include <random.h>
|
||||
|
||||
const int _random_a = 100003;
|
||||
const int _random_c = 114514 + 33;
|
||||
const int _random_m = 1000000007;
|
||||
int seed = 0;
|
||||
|
||||
int random(void)
|
||||
{
|
||||
seed = _random_a * (seed + _random_c) % _random_m;
|
||||
return seed;
|
||||
}
|
||||
Reference in New Issue
Block a user