#include <stdio.h>
int main() {
int arr[5];
int max, min, diff;
for (int i = 0; i < 5; i++) {
}
max = arr[0];
min = arr[0];
for (int i = 1; i < 5; i++) {
if (arr[i] > max) {
max = arr[i];
}
if (arr[i] < min) {
min = arr[i];
}
}
diff = max - min;
printf("最大値と最小値の差: %d\n", diff
);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbigpIHsKICAgIGludCBhcnJbNV07CiAgICBpbnQgbWF4LCBtaW4sIGRpZmY7CiAgICAKICAgIHByaW50ZigiNeOBpOOBruaVtOaVsOOCkuWFpeWKm+OBl+OBpuOBj+OBoOOBleOBhDpcbiIpOwogICAgCiAgICBmb3IgKGludCBpID0gMDsgaSA8IDU7IGkrKykgewogICAgICAgIHNjYW5mKCIlZCIsICZhcnJbaV0pOwogICAgfQogICAgCiAgICBtYXggPSBhcnJbMF07CiAgICBtaW4gPSBhcnJbMF07CiAgICAKICAgIGZvciAoaW50IGkgPSAxOyBpIDwgNTsgaSsrKSB7CiAgICAgICAgaWYgKGFycltpXSA+IG1heCkgewogICAgICAgICAgICBtYXggPSBhcnJbaV07CiAgICAgICAgfQogICAgICAgIGlmIChhcnJbaV0gPCBtaW4pIHsKICAgICAgICAgICAgbWluID0gYXJyW2ldOwogICAgICAgIH0KICAgIH0KICAgIAogICAgZGlmZiA9IG1heCAtIG1pbjsKICAgIAogICAgcHJpbnRmKCLmnIDlpKflgKQ6ICVkXG4iLCBtYXgpOwogICAgcHJpbnRmKCLmnIDlsI/lgKQ6ICVkXG4iLCBtaW4pOwogICAgcHJpbnRmKCLmnIDlpKflgKTjgajmnIDlsI/lgKTjga7lt646ICVkXG4iLCBkaWZmKTsKICAgIAogICAgcmV0dXJuIDA7Cn0K