随机数.c

#include <stdio.h>

int main()
{
    int a[10] = {0};
    int i = 0;
    
    srand(time(NULL));

    for (i = 0; i < 10; ++i)
    {
        a[i]= rand() % 10;    // 1 - N 
    }
    
    for (i = 0; i < 10; ++i)
    {
        printf("%d", a[i]);
    }
	printf ("\n------------------\n");
	
	return 0;
}

猜你喜欢

转载自blog.csdn.net/qq_40383812/article/details/84523192