title: Input strings and display reversely using for loops with arrays
body: <p>What I want to do is to enter a number of loops , then all the entered words will be displayed on reverse . I tried numbers to display on reverse , and it works . But , I don't know what to change in the codes . I'm not good in c++ , so I'm practicing . Thanks for helping me =)</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  using namespace std;
  
  int main()
  {
      int x, y;
      string a[y];
      cout &lt;&lt; "Enter number: ";
      cin &gt;&gt; x;
      x=x-1;
      for (y=0; y&lt;=x; y++)
      {
          cout &lt;&lt; y+1 &lt;&lt; ". ";
          cin &gt;&gt; a[y];
      }
      for (y=x; y&gt;=0; y--)
      {
          cout &lt;&lt; a[y] &lt;&lt; endl;
      }
      return 0;
  }
  </code></pre>