Homework 11 2016 5 13 read in file do input

Source: Internet
Author: User

#include <iostream>
#include <fstream>

using namespace Std;

int main ()
{
string x, Y, Z;
Cin >> x >> y >> z;

Ifstream file1 (X.c_str ());
Ifstream file2 (Y.c_str ());
Ofstream File3 (Z.c_str ());

String A, B;
Getline (File1,a);
Getline (FILE2,B);
int Aa=a.length ();
int Bb=b.length ();
cout<< "Length of file1:" <<aa<<endl<< "Length of file2:" <<bb<<endl;
if (AA&GT;=BB) {
AA=BB;
}
BOOL flag = TRUE;
for (int i=0;i<aa;i++) {
if (A[i]!=b[i]) {
cout<< "File1:";
cout<<a<<endl;
cout<< "File2:";
cout<<b<<endl;
File3 << "Different" << i << Endl;
cout << "Different" << i << Endl;
Flag = false;
Break
}
}
if (flag) {
cout<< "File1:";
cout<<a<<endl;
cout<< "File2:";
cout<<b<<endl;
File3 << "Same" << AA << Endl;
cout << "Same" << AA << Endl;
}

File1.close ();
File2.close ();
File3.close ();
}

Homework 11 2016 5 13 read in file do input

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.