Poker face

Poker poker.

Write a program that receives 3 ints, and outputs the median. The median of 3 ints is here defined as follows: if two (or more) of the ints are equal, then the median is equal to their value; otherwise, the median is the unique int of the three such that one is greater than it and one is less than it.

Input

3 ints.

Output

The median of the 3 input ints.

Observation

You may flesh out the following code:

import java.io.*;
import java.util.*;

class Main {

    public static int median( int a, int b, int c )
    {
        // FILL THIS OUT
        return 0;
    }

    public static void main (String[] args) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        int b = in.nextInt();
        int c = in.nextInt();

        System.out.println( median( a, b, c ));
    }

}

Problem information

Author: Hubie Chen

Generation: 2026-01-25T22:03:48.378Z

© Jutge.org, 2006–2026.
https://jutge.org