荣威360电子说明书:TC的random是什么意思?怎么用?
来源:百度文库 编辑:杭州交通信息网 时间:2024/06/16 06:17:03
怎么用呢?
#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范围内产生随机数。