Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - C language for help! ! ! ! ! ! ! ! Define an integer array, enter n numbers from the keyboard, and then find the minimum value, which crosses the element with subscript 0.
C language for help! ! ! ! ! ! ! ! Define an integer array, enter n numbers from the keyboard, and then find the minimum value, which crosses the element with subscript 0.
Landlord, I'm sorry, I didn't notice just now. Now I have revised it. You can see for yourself what's wrong. I modified it on your basis, and VC6.0 has been debugged successfully.

# include & ltstdio.h & gt

# include & ltconio.h & gt

# Define MAXSIZE 100

int main()

{

float a[MAXSIZE],temp,min

int i,n,k = 0;

Printf ("Please enter the total number of this batch:");

scanf("%d ",& ampn);

Printf ("\ nPlease enter this batch number:");

for(I = 0; I & ltn;; i++)

scanf("%f ",& ampa[I]);

min = a[0];

for(I = 1; I & ltn;; i++)

{

if(min & gt; a[i])

{ min = a[I]; k = I; }

}

temp = a[0];

A[0]= minimum value;

a[k]= temp;

for(I = 0; I & ltn;; i++)

printf("%4. 1f ",a[I]);

printf(" \ n ");

getch();

Returns 0;

}