全部问题 > 当前问题

srand&rand

#include<studio.h>

#include<stdlib.h>

#include<time.h>

main()

{

int t,i;

time(&t);

srand(t);

for(i=1;i<=5;i++)

{

printf("%d\n",rand());

}

}

老师这个程序报错,我看不出问题来。请教~

倪颖轩 2015-7-11 21:56:41

共 3 个回答

祁老师 2015-7-13 09:54:45

#include<studio.h>  这里头文件写错了

匿名课官 2018-3-7 20:26:10

题目不更新吗

匿名课官 2018-3-7 20:26:25

题目不更新吗

问题来自: 随机数