📜  随机数 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:46.333000             🧑  作者: Mango

代码示例6
// C program to generate random numbers
#include 
#include 
#include
 
// Driver program
int main(void)
{
    // This program will create different sequence of
    // random numbers on every program run
 
    // Use current time as seed for random generator
    srand(time(0));
 
    for(int i = 0; i<4; i++)
        printf(" %d ", rand());
 
    return 0;
}