Homework sol. for ZhaoQinpei's C courses