void main()
{
int a[10],i,max,min,j=0,l=0;
printf("please input tem num:");
for(i=0;i<10;i++)
scanf("%d",&a[i]);
max=a[0];
min=a[0];
if(max { max=a[i]; j=i; } if(min>a[i]) { min=a[i]; l=i; } } printf("max is %d on a[%d]\n",max,j); printf("min is %d on a[%d]\n",min,l); getch(); } 测试通过 .??? 有啊,看我的结果楼主再试下,或者删去getch();试试
max=a[i];
j=i;
}
if(min>a[i])
min=a[i];
l=i;
printf("max is %d on a[%d]\n",max,j);
printf("min is %d on a[%d]\n",min,l);
getch();
测试通过 .??? 有啊,看我的结果楼主再试下,或者删去getch();试试