fix: seed C array example randomness once across translations (#1910)

Co-authored-by: krahets <krahets@163.com>
This commit is contained in:
mazezen
2026-10-11 02:23:46 +08:00
committed by GitHub
parent e0f6d18618
commit 7afce71b13
5 changed files with 15 additions and 0 deletions

View File

@@ -70,6 +70,9 @@ int find(int *nums, int size, int target) {
/* Driver Code */
int main() {
/* 初始化随机种子(只需执行一次) */
srand((unsigned)time(NULL));
/* 初始化数组 */
int size = 5;
int arr[5];

View File

@@ -70,6 +70,9 @@ int find(int *nums, int size, int target) {
/* Driver Code */
int main() {
/* Initialize the random seed once */
srand((unsigned)time(NULL));
/* Initialize array */
int size = 5;
int arr[5];

View File

@@ -70,6 +70,9 @@ int find(int *nums, int size, int target) {
/* Driver Code */
int main() {
/* 乱数のシードを一度だけ初期化する */
srand((unsigned)time(NULL));
/* 配列を初期化 */
int size = 5;
int arr[5];

View File

@@ -70,6 +70,9 @@ int find(int *nums, int size, int target) {
/* Driver Code */
int main() {
/* Инициализировать генератор случайных чисел один раз */
srand((unsigned)time(NULL));
/* Инициализация массива */
int size = 5;
int arr[5];

View File

@@ -70,6 +70,9 @@ int find(int *nums, int size, int target) {
/* Driver Code */
int main() {
/* 初始化隨機種子(只需執行一次) */
srand((unsigned)time(NULL));
/* 初始化陣列 */
int size = 5;
int arr[5];