#S0004. 数字统计

数字统计

1. Description

Create a number statistics program. The user inputs multiple integers. The program should output:

  • Mode (the most frequent number; if multiple modes exist, choose the smallest)
  • Median (rounded to 1 decimal; if even count, take the average of the two middle numbers)

2. Input & Output

Input:

  • A line of space-separated integers

Output:

  • First line: mode
  • Second line: median

Example

# Input:  
5 2 3 5 4 5 1  
# Output:  
5  
4.0  
# Input:  
3 3 2 2 1  
# Output:  
2  
2.0