The C++ version is taking a compile and runtime short cut by using printf instead of iostream.
This pull request has timings with this changed: https://github.com/atilaneves/pythagoras/pull/1#issuecomment...
This pull request has timings with this changed: https://github.com/atilaneves/pythagoras/pull/1#issuecomment...
Not everyone is micro-optimizing their code just to save a couple of needless extra ms.
I never, ever since 1993, had to work on a C++ project where stdio vs iostream performance made any worthwhile difference, besides stdio being less secure to use.