# include <stdio.h>
int main(void)
{
int len, i;
scanf("%d", &len);
int a[len];
int max, min, j;
for(i=0; i<len; ++i)
scanf("%d", a[i]);
max = a[0];
min = a[0];
for(i=1; i<len; ++i)
{
if(max < a[i])
{
j = max;
max = a[i];
a[i] = j;
}
if(min > a[i])
{
j = min;
min = a[i];
a[i] = j; //编译器提示问题在这,但是总想不出为什么??
}
}
return 0;
}
江户川秋风
相关分类