C语言产随机数

#include "stdio.h"
#include "stdlib.h"
#include "time.h"

void main(void)
{
	int i;
	srand((unsigned)time(NULL));
	while(1){
		i=rand()%100;
		printf("%d\n",i);
	}
}

你可能感兴趣的:(C语言产随机数)