c++中怎样循环打开多个文本文件并对每一个输入字符

2025年03月19日 09:48
有1个网友回答
网友(1):

#include
#include
#include

using namespace std;
int main()
{
string def="Who are you?";
fstream file;
while(1){
file.open("a.txt",ios::app);
file<file.close();
file.open("b.txt",ios::app);
file<file.close();
file.open("c.txt",ios::app);
file<file.close();
}
}