#include<iostream> #include<iomanip> #include<fstream> using namespace std; int main() { fstream in; fstream out; in.open("in.txt",ios::in); out.open("out.txt",ios::out); char ch; while(in.get(ch))out.put(ch); system("pause"); return 0; } 为了便于看清晰 复制 过程 就没有检查是否文件打开有异常