Refine DIP homework 1 for cross-platform compatibility.

Refine DIP homework 1 for cross-platform compatibility. Old code are
commentized.