柯江 房子:TC的random是什么意思?怎么用?

来源:百度文库 编辑:高校问答 时间:2024/04/29 18:15:08
怎么用呢?

#include <stdlib.h>
#include <stdio.h>
#include <time.h>

/* prints a random number in the range 0 to 99 */
int main(void)
{
randomize();
printf("Random number in the 0-99 range: %d\n", random (100));
return 0;
}

产生随机数的。
random()

随机

random是随机的意思。
作用:产生随机数的 比如:求任意****
a=random()
a是变量

random为库函数,产生随机数,
random(int x);
在x范围内产生随机数。