program MinMax
implicit none
integer :: a
integer :: b
integer :: c
integer :: min
integer :: max
read *, a, b, c
min = a
max = a
if(min > b) then
min = b
else if(max < b) then
max = b
end if
if(min > c) then
min = c
else if(max < c) then
max = c
end if
print *, "min = ", min, " max = ", max
end program MinMax
MIN()和MAX()函数