title: Creating a phrase given a string vector of words in c++
body: <p>So far my c++ program looks like this:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;vector&gt;
  #include &lt;algorithm&gt;
  
  using namespace std;
  
  int main() {
      int i;
      int maxLet;
      const int NumWords = 26;
      const int NumPhrase = 8;
      string ele;
      string n[NumWords] = {
          "crypt",  "by",     "my",     "cysts",  "glyph", "psych", "shyly",
          "slyly",  "try",    "sylph",  "tryst",  "gypsy", "ply",   "pry",
          "shy",    "sly",    "spy",    "thy",    "cry",   "sty",   "glyphs",
          "sylphs", "trysts", "crypts", "psychs", "sprly"};
      vector&lt;string&gt; words(n, n + NumWords);
      vector&lt;string&gt; phrase(n, n + NumPhrase);
      for (i = 0; i &lt; words.size(); i++) {
          cout &lt;&lt; words.at(i) &lt;&lt; endl;
          cout &lt;&lt; words[i] &lt;&lt; endl;
      }
  
      char aaaaa;
      cin &gt;&gt; aaaaa;
      return 0;
  }
  </code></pre>
  
  <p>I need to create a phrase that resembles
  [YYY] [YYYYY] [YYYBC] [GHLLLM] [PPPRR] [RS] [SS] [SSTTT]
  Where The letters are all scrambled and the brackets denote the length of the word.
  Essentially I need to create a phrase of words with those specific word lengths, and those specific number of letters
  total there are,
  11 y's
  1 b
  1 c
  1 g
  1 h
  3 L's
  1 m
  3 p's
  3 r's
  5 s's
  3t's
  I have been pulling my hair out trying to figure out how to do it.  Your input would be greatly appreciated.</p>