title: Sorting Variables C++
body: <p>I am trying to get a count from a list of 20 variables then sort the output in descending order in the form of a string.  Each time a person chooses a certain type of music, that type of music will ++ it's variable by one.  At the end of 10 days it needs to be sorted and output the type names in order. Here is a shorter example:</p>
  
  <pre><code>int rock;
  int jazz;
  int pop;
  
  int count = 0;
  int days = 0;
  
  while(days &lt; 10) {
  
  cout &lt;&lt; "Choose your style: " &lt;&lt; "\n";
  cout &lt;&lt; "1. Rock" &lt;&lt; "\n";
  cout &lt;&lt; "2. Jazz" &lt;&lt; "\n";
  cout &lt;&lt; "3. Pop" &lt;&lt; "\n";  
  cin &gt;&gt; count; 
  
  switch(count) {
  
      case 1:
      ++rock;
      break;
  
      case 2:
          ++jazz;
          break;
  
      case 3:
          ++pop;
          break;
  
  }
  
  ++days
  }
  
  // Now sort the styles in order of most used???
  // output based on that order ie:
  
  cout &lt;&lt; "You Love Pop Music most! Rock seems to be your next Favorite. \n";
  cout &lt;&lt; "You are not much of a jazz person.\n";
  </code></pre>
  
  <p>Any help is much appreciated.  Thanks.</p>