It is required to generate a histogram distribution for a set of daily average temperatures recorded in Antarctica. The temperatures are integer values in the range -40°C to +5°C. Design an algorithm to input n such temperatures and produce the appropriate distribution.