Feat: lab 4

This commit is contained in:
2025-03-21 03:39:25 +08:00
parent ed2ced5caf
commit 45ebb20cf2
35 changed files with 833 additions and 174 deletions

12
kernel/lib/random.c Normal file
View 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;
}