A program that accepts numbers and computes their sum, and displays smallest and largest number
Use maps to handle mappings

instead of having constants for each individual ratio, you might as well have a single constant that holds both the ratios and their respective strings, as well as being able to map one to the other.

Consider this:

const std::unordered_map&lt;std::string, double&gt; unit_ratios = {
  {"m", 1.0},
  {"cm", 0.01},
  {"ft", 0.3048},
  {"in", 0.0254}
};

int main() {
  std::vector&lt;double&gt; numbers;

  double temp;
  std::string temp_unit;
  while(cin&gt;&gt;temp&gt;&gt;temp_unit){
    try {
      numbers.push_back(temp * unit_ratios.at(temp_unit));
    }
    catch(const std::out_of_range&amp;) {
      cout&lt;&lt;"Incorrect Unit\n";
    }
  }
...
}


Doesn't that look nicer? all the names and ratios nicely bundled together in one spot. 

That's also why I've set it as a global constant in my example: The ratios and their name have nothing to do with the main function, they just are, so they should exist out of context.

Declare variables as late as possible

double sum{0}; should be declared as close as possible to the first use.

Use algorithms when possible.

You can use std::accumulate to calculate the sum:

double sum = std::accumulate(numbers.begin(), numbers.end(), 0.0);


Use front() and back() to access the first and last elements of a vector

You could make an argument that numbers[0] is as good as numbers.front(), but not for the last element. 

cout&lt;&lt;"Smallest number: "&lt;&lt; numbers.front() &lt;&lt; endl;
cout&lt;&lt;"Largest number: "&lt;&lt; numbers.back() &lt;&lt; endl;


Do you really need to sort?

Sorting is a O(NlogN) operation, whereas std::max_element and std::min_element are both O(N).

Since you are only doing these two lookups through the vector, you might be better off just using these instead. 

If you can use c++11, then std::minmax_element is even better, since you only have to do one pass.

don't use using namespace std;

Just... just don't. Please see every other C++ question on this site as to why.