title: Run time error, Jolly jumpers
body: <p>Im solving the Jolly Jumpers problem using an online compiler: <a href="https://ideone.com/" rel="nofollow">https://ideone.com/</a>. Its shows me the correct answer but tells me that there is a run time error. </p>
  
  <pre><code>#include&lt;stdio.h&gt;
  int main()
  {
      unsigned int n,a[3000];
  
      do
      {
          int aux=0,j=1, i;
  
          scanf("%i",&amp;n);
  
          for(i=0;i&lt;n;i++)
          {
              scanf("%ui",&amp;a[i]);
          }
  
  
          for(i=0;i&lt;n;i++)
          {
              if(a[i]&lt;a[i+1])
              {
                  if((a[i+1]-a[i])==(n-j)){
                      aux++;
                  }
                  else{
                      break;
                  }
  
              }else{
                  if((a[i]-a[i+1])==(n-j))
                      aux++;
  
                  else
                      break;
              }
  
              j++;
          }
          if(aux==(n-1))
              printf("Jolly");
  
          else
              printf("Not jolly");
      }
      while(!feof(stdin));
      return 0;
  }
  </code></pre>
  
  <p>The rune time error is in the <code>while(!feof(stdin)</code>, makes an infinity loop, is there another way to read from the keyboard and at the same time evaluate? . Thanks for the help.</p>