Calculator for scoring dives in a competition
Variables should be initialized with proper values when declared (if not, they should be declared as close to the point of usage as practical). This way there's no need to initialize them to some invalid value, or risk leaving them uninitialized. (difficulty and ret are the main offenders here, but total, min and max should be declared just before the loop using them).
I'm not sure there's much point in the using std::foo;. It's probably as much work to keep track of what you're using and update the declarations than just typing std:: where necessary. But it's better than using namespace std;, so that's good. :)
The prompt message to the user asking for input could be passed as a parameter to getInput and printed as part of the function.
The min and max values could also be shown when requesting an input.





Consider splitting the main function into two phases: getting input, calculating the result. This may make the program a little easier to understand.
Certain things could be split off into separate functions. e.g. String to float conversion and calculating the overall score.


These last two are really just suggestions though; the original code is very good.

Edited code, with some alternative ways of doing things:

#include &lt;iostream&gt;
#include &lt;sstream&gt;
#include &lt;string&gt;
#include &lt;vector&gt;
#include &lt;algorithm&gt;
#include &lt;cassert&gt;

constexpr auto JUDGES = 7;
constexpr auto FUDGE_FACTOR = 0.6f;
constexpr auto MIN_DIFFICULTY = 1.2f;
constexpr auto MAX_DIFFICULTY = 3.8f;
constexpr auto MIN_SCORE = 0.f;
constexpr auto MAX_SCORE = 10.f;

bool toFloat(std::string const&amp; string, float&amp; value)
{
    std::stringstream ss(string);
    return (ss &gt;&gt; value &amp;&amp; ss.eof());
}

bool isInRange(float value, float low, float high)
{
    return (value &gt;= low &amp;&amp; value &lt;= high);
}

float getFloatInput(float low, float high, std::string const&amp; prompt)
{
    while (true)
    {
        std::cout &lt;&lt; prompt &lt;&lt; " [" &lt;&lt; low &lt;&lt; ", " &lt;&lt; high &lt;&lt; "]: ";

        std::string line;
        std::getline(std::cin, line);

        auto value = 0.f;
        if (toFloat(line, value) &amp;&amp; isInRange(value, low, high))
            return value;

        std::cout &lt;&lt; "invalid input!\n";
    }

    assert(false);
    return -1.0f;
}

std::vector&lt;float&gt; getJudgesScores()
{
    auto scores = std::vector&lt;float&gt;();

    for (auto i = 0; i != JUDGES; ++i)
        scores.push_back(getFloatInput(MIN_SCORE, MAX_SCORE, "score #" + std::to_string(i + 1)));

    return scores;
}

float calculateOverallScore(std::vector&lt;float&gt; const&amp; scores, float difficulty)
{
    auto min = MAX_SCORE;
    auto max = MIN_SCORE;
    auto sum = 0.f;

    for (auto score : scores)
    {
        min = std::min(min, score);
        max = std::max(max, score);
        sum += score;
    }

    sum -= (min + max);

    return sum * difficulty * FUDGE_FACTOR;
}

int main()
{
    auto difficulty = getFloatInput(MIN_DIFFICULTY, MAX_DIFFICULTY, "difficulty");
    auto judgesScores = getJudgesScores();
    auto overallScore = calculateOverallScore(judgesScores, difficulty);

    std::cout &lt;&lt; "The dive scored: " &lt;&lt; overallScore &lt;&lt; std::endl;
}