Using buffer to optimize the printf; Add strapp() and flush()