mirror of
https://github.com/krahets/hello-algo.git
synced 2026-10-24 15:05:18 +08:00
fix: seed C array example randomness once across translations (#1910)
Co-authored-by: krahets <[email protected]>
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user