title: working of a faster I/O method
body: <p>I was studying faster I/O methods for programming problems,
  I found out this method of using <code>getchar_unlocked()</code>  (though risky but still).</p>
  
  <p>I looked around quite a bit but couldn't get how it scanned an integer value
  or in other words what do the 4 lines mean and how they work in the <code>scanint()</code> function
  defined below </p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;cstdio&gt;
  #define gc getchar_unlocked
  
  void scanint(int &amp;x)
  {
      register int c = gc();
      x = 0;
      for(;(c&lt;48 || c&gt;57);c = gc());
      for(;c&gt;47 &amp;&amp; c&lt;58;c = gc())   
          {x = (x&lt;&lt;1) + (x&lt;&lt;3) + c - 48;}
  }
  
  int main()
  {   
      int n,k;
      scanint(n);
      scanint(k);
      int cnt=0;
      while(n--)
      {
       int num;
       scanint(num);
       if(num%k==0)cnt++; 
      }    
      printf("%d",cnt);
      return 0;             
  }
  </code></pre>