数组求一个数组的最小数
int number[20] = {0};
int min = 0;
for (int i = 0; i < 20; i++) {
number[i] = arc4random() % (50 - 10 + 1) + 10;
printf("%d ", number[i]);
if (number[min] > number[i]) {
min = i;
}
}
printf("\nmin = %d\n", number[min]);
2022-10-30 16:20:46
数组求一个数组的最小数
int number[20] = {0};
int min = 0;
for (int i = 0; i < 20; i++) {
number[i] = arc4random() % (50 - 10 + 1) + 10;
printf("%d ", number[i]);
if (number[min] > number[i]) {
min = i;
}
}
printf("\nmin = %d\n", number[min]);