#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>=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();
}

最新文章

  1. centos下建立双机信任关系
  2. Zookeeper概论(对zookeeper的概论、原理、架构等的理解)
  3. C# 换行符
  4. Mysql-通过case..when实现oracle decode()函数进行多值多结果判断
  5. linux 使用 pyodbc 访问 ms sqlserver 数据库
  6. 用Delphi实现文件关联
  7. json-lib-2.4.jar Bug,json字符串中value为&quot;[value]&quot;结构时,解析为数组,不会解析成字符串
  8. 【UVA 10816】 Travel in Desert (最小瓶颈树+最短路)
  9. writev/readv
  10. Hibernate 查询:HQL查询(Hibernate Query Languge)
  11. TDD(测试驱动开发)学习一:初识TDD
  12. bitset基础用法+心得
  13. win10 删除设备和驱动器中你不要的图标
  14. STL --&gt; list用法
  15. ueditor图片无法左右对齐的解决
  16. Libgdx1.6.2发布,跨平台游戏开发框架
  17. WITH RECOMPILE和OPTION(RECOMPILE)区别
  18. 【转发】Cookie存储的值大小限制和个数问题
  19. 5.JVM的内存区域划分
  20. django的数据库操作

热门文章

  1. sql创建表格 转载
  2. List与字符串转换
  3. 【摘】使用tail、head命令过滤行
  4. Spark JdbcRDD 简单使用
  5. 浅谈OpenGL变换矩阵
  6. Java基础以及与C++的一些对比
  7. 登陆mysql时出现unknown variable &#39;character_set_client=UTF8&#39; 的错误
  8. java如何得到GET和POST请求URL和参数列表(转)
  9. 第一零二天上课 PHP TP框架 引入文件路径问题和调用验证码的方式
  10. Unity IoC Container创建对象过程