Find the Minimum Positive Value
问题 What's the best algorithm to find the smallest non zero positive value from a fixed number (in this case 3) of values or return 0 if there are no positive questions? My naive approach is below (in Delphi, but feel free to use whatever you like), but I think there's a more elegant way. value1Temp := MaxInt; value2Temp := MaxInt; value3Temp := MaxInt; if ( value1T > 0) then value1Temp := value1; if ( value2 > 0) then value2Temp := value2; if ( value3 > 0) then value3Temp := value3; Result :=