C solution.

Reviewed by @tolmasky.
Merge pull request #11 from tolmasky/somethingdifferent

C solution.