#include <stdio.h>
int main()
{
int a[5] ={1, 3, 5, 2, -1};
int min, max;
int i;
min = max = a[0];
for (i = 1; i < 5; i++) {
if (a[i] < min) min = a[i];
if (max < a[i]) max = a[i];
}
printf("min=%d max=%d\n", min
, max
); return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbigpCnsKCWludCBhWzVdID17MSwgMywgNSwgMiwgLTF9OwoJaW50IG1pbiwgbWF4OwoJaW50IGk7CgoJbWluID0gbWF4ID0gYVswXTsKCWZvciAoaSA9IDE7IGkgPCA1OyBpKyspIHsKCQlpZiAoYVtpXSA8IG1pbikgbWluID0gYVtpXTsKCQlpZiAobWF4IDwgYVtpXSkgbWF4ID0gYVtpXTsKCX0KCXByaW50ZigibWluPSVkIG1heD0lZFxuIiwgbWluLCBtYXgpOwoJcmV0dXJuIDA7Cn0K