title: The three biggest numbers in array
body: <pre><code>#include&lt;iostream&gt;
  using namespace std;
  int main()
  {
      int s;
      cin&gt;&gt;s;
      int t=3;
      int maxValue,imax[t],maxIndex,arr[s];
      for(int i=0; i&lt;s; i++){
          cin&gt;&gt;arr[i];
      }
      maxValue=arr[0];
      for(int i=0;i&lt;s;i++){
          if(arr[i]&gt;maxValue){
               maxValue=arr[i];
               imax[0] = i;
          }
      }
      maxValue=arr[0];
      for(int i=0;i&lt;s;i++){
          if (i == imax[0]) { continue; }
          if(arr[i]&gt;maxValue){
              maxValue=arr[i];
              imax[1] = i;
          }
      }
      maxValue=arr[0];
      for(int i=0;i&lt;s;i++){
          if (i == imax[0]) { continue; }
          if (i == imax[1]) { continue; }
          if(arr[i]&gt;maxValue){
              maxValue=arr[i];
              imax[2] = i;
          }
      }
      cout&lt;&lt;"First biggest number:"&lt;&lt;arr[imax[0]]&lt;&lt;"\n";
      cout&lt;&lt;"Second biggest number:"&lt;&lt;arr[imax[1]]&lt;&lt;"\n";
      cout&lt;&lt;"Third biggest number:"&lt;&lt;arr[imax[2]];
      return 0;
  }
  </code></pre>
  
  <p>This program must return tree numbers which is biggest in this arraybut , i do not know why when  I introduce as example five numbers (121,34,56,67,545) and the compiler was return 545 and then crash.
  Thank you in advance for the answer.</p>