Why is C slower than Bolin?
When I run the &quot;faster&quot; C code, it takes 176 ms. When I run this C++ code:<p><pre><code>  #include &lt;iostream&gt;
  #include &lt;fstream&gt;
  int main() {
    auto&amp; out = *std::cout.rdbuf();
    std::filebuf in;
    in.open(&quot;&#x2F;tmp&#x2F;numbers&quot;, 
      std::ios::in);
    for (int c, n = 0; 
         (c = in.snextc()) != EOF;) {
      if (c != &#x27;\n&#x27;) {
        n = n * 10 + (c - &#x27;0&#x27;);
      } else {
        out.sputc((n &amp; 7) + &#x27;0&#x27;), n = 0;
      }
    }
    std::cout &lt;&lt; &#x27;\n&#x27;;
  }
</code></pre>
it takes 84 ms (and presumably 90 ms on the author&#x27;s machine).<p>So, why is Bolin slower (and longer) than C++? And why is so much of published code so bad?