如何产生随机数

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{
    int x=0,i;
    srand((unsigned int)time(NULL));
    for(i=0;i<10;i++)
    {
        x=rand()%100;
        printf("%d ",x);
    }
    return 0;
}


猜你喜欢

转载自blog.csdn.net/nanfengzhiwoxin/article/details/80751574