随机函数的代码(srand、rand)

时间:2023-11-14 23:34:50

#include<stdio.h>

int main()

  int counter;

  for(counter=0;counter<10;counter++)

  {

  srand(counter+1);

  printf("random number %d is :%d\n",counter,rand());

  }
  return 0;

}

相关文章