1 2 3 4

C语言之随机数

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

int main()
{

int x = 0;

srand((unsigned)time(NULL));
x = rand() %10;

printf("产生的随机数是:%d \n", x);

 

 

system("pause");
return 0;
}

posted on 2020-12-09 15:59  三日坊主i  阅读(57)  评论(0)    收藏  举报

导航