最佳答案:代码如下,可以参考:将数据“写入、输出”到文件中#include<fstream>#include<iostream>using namespace std;int main(