#include#include#includeusing namespace std;void CompFile(string a,string b){ string A,B; char yes; int line=1; ifstream input1; ifstream input2; input1.open(a.c_str());
//打开文件 input2.open(b.c_str()); while(!input1.eof() && !input2.eof()) {getline(input1,A);
//读入行getline(input2,B);if(A!=B)
//比较{ coutyes; if(yes!='y')break;}line++; }}void Input(string a, string b){
cout>file1>>file2;}int main(){
string file1,file2;
Input(file1,file2);
CompFile(file1,file2);
return 0;} |