GenerateMethod.cpp 404 B

1234567891011121314151617181920
  1. //05/27/2024 Li SiHan Added Start
  2. #include"pch.h"
  3. #include "GenerateMethod.h"
  4. //随机数生成所需要引用的包
  5. #include<stdlib.h>
  6. #include<time.h>
  7. int* RandomArrayCreate(int Arraylength)
  8. {
  9. int static arr[10];
  10. srand((unsigned int)time(NULL));
  11. for (int i = 0; i < Arraylength; i++)
  12. {
  13. arr[i] = 1 + rand() % 100;
  14. }
  15. return arr;
  16. }
  17. //05/27/2024 Li SiHan Added End