title: Checking rainbow array(checking if array's reverse style matches with itself)
body: <pre><code>#include &lt;iostream&gt;
  int main(){
      bool check;
      int lenght=1,height=1;
      int array[height][lenght];
      std::cin&gt;&gt;height;
      int a=0;
      for(int i=1;i&lt;=height;i++){
          std::cin&gt;&gt;lenght;
          for(int i=0;i&lt;=lenght;i++)
              std::cin&gt;&gt;array[a][i];
          if (lenght%2==0){
              int array1[height][lenght/2],array2[height][lenght/2];
              for(int i=0;i&lt;=lenght/2;i++)
                  array1[a][i]=array[a][i];
              for(int i=0;i&lt;=lenght/2;i++)
                  array2[a][i]=array[a][lenght-i-1];
              for(int i=0;i&lt;=lenght/2;i++)
                  if(array1[a][i]!=array2[a][i])
                  check= false;
              a++;
          check=true;
          if(check==true)
          std::cout&lt;&lt;"its rainbow array ! ";
          else
          std::cout&lt;&lt;"you cant get any unicorn :( ";
          }
          else{
              int array1[height][lenght/2-1],array2[height][lenght/2-1];
              for(int i=0;i&lt;lenght/2-1;i++)
                  array1[a][i]=array[a][i];
              for(int i=0;i&lt;lenght/2-1;i++)
                  array2[a][i]=array[a][lenght-i-1];
              for(int i=0;i&lt;lenght/2-1;i++)
                  if(array1[a][i]!=array2[a][i])
                  check= false;
              a++;
          check=true;
          if(check==true)
          std::cout&lt;&lt;"its rainbow array ! ";
          else
          std::cout&lt;&lt;"you cant get any unicorn :( ";
          }
      }
  
  }   
  </code></pre>
  
  <p>Sorry for bad English. I'm trying to check if we divide an array to half, then check if these pieces matches.
  For example = 1,2,3,4,5,6==> This is not rainbow array
  1,2,3,4,5,4,3,2,1==> This is rainbow array.
  This is how program should work:</p>
  
  <blockquote>
    <p>1=User enters an integer, that will be our height, tells us how many number lists we will test.
    2=User enter integer how long first list will be. Then program will get inputs from user for list.
    3=Program should separate major list to 2 minor lists.
    4=Program copying major list's elements to 2 minor list's.</p>
  </blockquote>
  
  <p>At the final stage, it compares 2 list and changing bool value to true or false. But in my situation its always true. Here is a working code that i wrote few hours ago.</p>
  
  <pre><code>#include &lt;iostream&gt;
  bool checkarray(int *array,int lenght);
  int main(){
      int array[9]={1,2,3,4,5,4,3,2,4};
      int lenght=9;
      if(checkarray(array,lenght)==true)
          std::cout&lt;&lt;"its rainbow array ! ";
      else
          std::cout&lt;&lt;"you cant get any unicorn :( ";
  }
  bool checkarray(int array[],int lenght){
      if (lenght%2==0){
          int array1[lenght/2],array2[lenght/2];
          for(int i=0;i&lt;=lenght/2;i++)
              array1[i]=array[i];
          for(int i=0;i&lt;=lenght/2;i++)
              array2[i]=array[lenght-i-1];
          for(int i=0;i&lt;=lenght/2;i++)
              if(array1[i]!=array2[i])
                  return false;
  
          return true;
          }
      else{
          int array1[lenght/2-1],array2[lenght/2-1];
          for(int i=0;i&lt;lenght/2-1;i++)
              array1[i]=array[i];
          for(int i=0;i&lt;lenght/2-1;i++)
              array2[i]=array[lenght-i-1];
          for(int i=0;i&lt;lenght/2-1;i++)
              if(array1[i]!=array2[i])
                  return false;
  
          return true;
      }
      }
  </code></pre>
  
  <p>But whenever i want add user experience, it happens like first code. Help please</p>