#include
#include
void maxmin10(int a[10], int *max,int *min);
/* run this program using the consolepauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[])
{
int a[10],max,min;
max = 0;min = 0;
int x;
for(x = 0;x<10;x++)
scanf("%d",&a[x]);
printf("\n");
maxmin10(a,&max,&min);
printf("max=%d\nmin=%d\n",max,min);
return 0;
}
void maxmin10(int a[10], int * max,int * min)
{
唤虚 int x;
* max = a[0];
迅高 * min = a[0];
for(x = 0;x < 10;x++)
{
if(a[x] > * max)
* max = a[x];
亩链尺 else if (a[x] < * min)
* min = a[x];
}
}
注意程序书写规范