Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - The value of one-dimensional integer array a is known. Find the value of the smallest element in a one-dimensional array and its position in the array.
The value of one-dimensional integer array a is known. Find the value of the smallest element in a one-dimensional array and its position in the array.
The code is written as follows:

int? min(int? *a,? int? n)

{

int? Me? r = 0;

For (me? =? 1; ? Me? & lt? n; ? Me? ++)

if(a[I]& lt; a[r])r = I;

Return? r;

}

int? Master ()

{

int? a[ 10]? =? {? 6,2,5,7,8,9, 1,0,3,4};

int? r=min(a, 10);

Printf ("Minimum Element? %d? Subscript to %d\n ",a [r],? r);

Return? 0;

}