生成随机数

/*程序2-4 生成随机数*/
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
int main()
{
	srand((unsigned)time(NULL));
	int n = rand();
	printf("%d\n",n);
	return 0;
}
具体代码如上图所示
全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务