美文网首页
10.28 随机数

10.28 随机数

作者: 当时光一去不复返时 | 来源:发表于2016-11-12 16:04 被阅读0次
//srand((unsigned)time(NULL));
//rand()%100
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
int main()
{
    int i;
    printf("...");
    srand((unsigned)time(NULL));
    for(i=0;i<10;i++)
    {
//        srand((unsigned)time(NULL));
        printf("%d   ",rand()%100);
    }
    printf("\n");
}

相关文章

网友评论

      本文标题:10.28 随机数

      本文链接:https://www.haomeiwen.com/subject/ktfeuttx.html