Back
Ghi_File.cpp
Save
// Ghi_File.cpp #include
using namespace std; int main() { string data; ofstream ofs; ofs.open("FILE1.txt"); ofs<<"7 2\n"; ofs<<"1 2 3 1\n"; ofs<<"2 2 4 1\n"; ofs<<"3 3 5 1"; ofs.close(); ofs.open("FILE2.txt"); ofs<<"4 1 1 2\n"; ofs<<"5 2 2 2\n"; ofs<<"6 3 3 2\n"; ofs<<"7 4 4 2"; ofs.close(); ofs.open("FILE3.txt"); ifstream ifs; ifs.open("FILE1.txt"); while (getline(ifs, data)) { ofs<