1 rewrited some code and using the way of cpp.
2 use the stream library of STD.