Auto commit
This commit is contained in:
parent
5b4d574902
commit
23fb17e13c
@ -569,6 +569,30 @@ int main(){
|
|||||||

|

|
||||||
|
|
||||||
```c
|
```c
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <limits.h> //里面定义了基本数据类型的最大值和最小值
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
int num[3][4], i, j, min=INT_MAX, i_index, j_index;
|
||||||
|
srand((unsigned)time(NULL));
|
||||||
|
|
||||||
|
for(i=0;i<3;i++){
|
||||||
|
for(j=0;j<4;j++){
|
||||||
|
num[i][j] = rand()%101;
|
||||||
|
printf("%2d ", num[i][j]);
|
||||||
|
if(num[i][j] < min){
|
||||||
|
min = num[i][j];
|
||||||
|
i_index = i;
|
||||||
|
j_index = j;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
|
printf("min=%d i=%d j=%d\n", min, i_index, j_index);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user