10#10include15 15 02using15 02namespace15 10std; 02struct15 07Sector15 { 15 10int16_t15 floor,15 ceil; 15 10char15 floortex[028],15 ceiltex[028]; 15 10int16_t15 light,15 special,15 tag; 15 10void15 07print(10int15 id) 15 { 15 cout15 <<15 05"05id:05"15 <<15 id15 <<15 05"05 05" 15 <<15 05"05floor:05"15 <<15 floor15 <<15 05"05 05" 15 <<15 05"05ceil:05"15 <<15 ceil15 <<15 05"05 05" 15 <<15 05"05ftex:05"15 <<15 floortex15 <<15 05"05 05" 15 <<15 05"05ctex:05"15 <<15 ceiltex15 <<15 05"05 05" 15 <<15 05"05light:05"15 <<15 light15 <<15 05"05 05" 15 <<15 05"05spec:05"15 <<15 special15 <<15 05"05 05" 15 <<15 05"05tag:05"15 <<15 tag15 <<15 05"05\n05"; 15 } }15 sectorA,15 sectorB; 10int15 07main(10int15 argc,15 10char**15 argv) { 15 02if15 (argc15 <15 023)15 {15 std::cout15 <<15 05"05usage: 05"15 <<15 argv[020]15 <<15 05"05 SECTORS1.lmp SECTORS2.lmp05\n05";15 02return15 021;15 } 15 ifstream15 fileA(argv[021]),15 fileB(argv[022]); 15 10bool15 endA15 =15 10false,15 endB15 =15 10false; 15 02for15 (10int15 i15 =15 020;15 !(endA15 &&15 endB);15 ++i) 15 { 15 02if15 (fileA.peek()15 ==15 EOF)15 endA15 =15 10true; 15 02else15 fileA.read((10char*)§orA,15 02sizeof(Sector)); 15 02if15 (fileB.peek()15 ==15 EOF)15 endB15 =15 10true; 15 02else15 fileB.read((10char*)§orB,15 02sizeof(Sector)); 15 02if15 (memcmp(§orA,15 §orB,15 02sizeof(Sector))) 15 { 15 02if15 (!endA15 &&15 !endB)15 { 15 cout15 <<15 05"05<<< 05";15 sectorA.print(i); 15 cout15 <<15 05"05>>> 05";15 sectorB.print(i); 15 } 15 02else15 02if15 (endB)15 {15 cout15 <<15 05"05--- 05";15 sectorA.print(i);15 } 15 02else15 02if15 (endA)15 {15 cout15 <<15 05"05+++ 05";15 sectorB.print(i);15 } 15 cout15 <<15 05"05\n05"; 15 } 15 } 15 02return15 020; }