简单C++程序修改

[复制链接]
查看11 | 回复0 | 2009-6-15 01:39:04 | 显示全部楼层 |阅读模式
#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;}
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行