#include
#include
#include
using namespace std;
int main() {
string temp;
ofstream out("out.txt");
//写高携祥入
cout << "输入字符开始写入隐耐:";
do{
getline(cin, temp);
out << temp << endl;
} while (temp != "end");
//读取
out.close();
ifstream in("out.txt");
cout << "开始读取写入戚搏的字符:" << endl;
while (getline(in, temp)) {
cout << temp << endl;
}
in.close();
}
望采纳,谢谢
缠着 二字用得好!