<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">/** An instance has function middle */
public class D {
    
    /** Return the middle of b, c, d. */
    public int middle(int b, int c, int d) {
        
        // Swap the smaller of b and c into b
        if (b &gt; c) {
            int temp= b;
            b= c;
            c= temp;
        }  
        
        if (c &lt;= d) {
            return c;
        }
        
        // b &lt;= c and the middle value is b or d
        // d &lt;= b means that b is middle
        // b &lt;= d means d is middle value
        return Math.min(d, b);
    }
    
}</pre></body></html>