integer userInput
integer i
integer mid
integer array(20) number
userInput = 1
for i = 0; userInput >= 0; i = i + 1
if number[i] > -1
userInput = Get next input
number[i] = userInput
i = i - 1
mid = i / 2
if i > 9
Put "Too many inputs" to output
elseif i % 2 == 0
Put number[mid - 1] to output
else
Put number[mid] to output