C++ ofstream和ifstream详细用法: https://www.cnblogs.com/batman425/p/3179520.html
若发现输出的内容不完整,可能是因为没有执行close()