finish the code part of hw6 , and uVA 10327.

finish the code part of hw6 , and uVA 10327.
also commit uVA 10810 , but it had got WA and hand't be resolved.