Well, I suppose the posted code could be educational if someone went through and sorted it out. As posted, it does need quite a bit of tidying up.
#1 As STL is being used, getmax() is not needed as std::max (and std::min) are already available.
http://www.cplusplus.com/reference/algorithm/max/
http://www.cplusplus.com/reference/algorithm/min/
#2 The variables should have better names, to say what they do: e.g. number1 should be max_value, etc.
amount -> count/num_entries
#3 The variables should all be initialized. This is a good habit to get into, as it makes debugging a lot easier. It also allows you to build at max warning level so you can spot those variables which need to be initialized.
#4 The loop logic can be simplified
- you don't have to special case index 1 to set the min and max. If you include <climits>, you can set the values to INT_MAX and INT_MIN (if the min value is init to MAX_INT, then you know the first i/p will always be less than or equal to it)
http://www.cplusplus.com/reference/clibrary/climits/
- or ever better, use the corresponding C++ mechanism: numeric_limits
http://www.cplusplus.com/reference/std/limits/numeric_limits/
- the need for the isset test should vanish in the refactoring.
#5 The code to get the number prefix (-st, -nd, ...) could (and should) be factored out.
#6 The code needs comments, esp. as it's an exercise. Not pointless ones, just restating what the function and variable names should make clear. But ones which call out the structure of the code.
#7 And I would space it out a bit to make the structure a bit clearer. Esp. as it's an exercise. Inc. following the advice of most programming texts, and putting a space either side of all operators to improve readability (not eveyone buys into this last point).
#8 And for Brownie points, you could avoid the "evil" (platform specific/dangerous to use/...) system call.