C语言随机数rand()和srand()使用
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main() {
int a = rand();
printf("%d", a);
putchar(10);
int b;
srand((unsigned) time(NULL));
b = rand();
printf("%d\t", b);
return 0;
}
posted on 2020-10-23 13:43 Indian_Mysore 阅读(59) 评论(0) 收藏 举报
浙公网安备 33010602011771号