random

Posted dixinfan

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了random相关的知识,希望对你有一定的参考价值。

 1 #include <stdio.h>
 2 #include <stdlib.h>
 3 #include <time.h>
 4 int main()
 5 { int i,number;
 6 double out;
 7 srand((unsigned) time(NULL)); 
 8 for (i=0; i<50; i++)
 9 {
10 number = rand() % 101; 
11 out=number*1.0;
12 printf("%f ", out);
13 }
14 return 0;
15 }

 

以上是关于random的主要内容,如果未能解决你的问题,请参考以下文章