{"id":"wdtmqb","deleted":false,"future_paste":false,"expired":false,"language":"cpp","created_at":"2025-09-24 06:16:00","expires_at":null,"content":"#include <bits\/stdc++.h>\r\nusing namespace std;\r\nstruct Sector {\r\n\tint16_t floor, ceil;\r\n\tchar floortex[8], ceiltex[8];\r\n\tint16_t light, special, tag;\r\n\tvoid print(int id)\r\n\t{\r\n\t\tcout << \"id:\" << id << \" \"\r\n\t\t     << \"floor:\" << floor << \" \"\r\n\t\t     << \"ceil:\" << ceil << \" \"\r\n\t\t     << \"ftex:\" << floortex << \" \"\r\n\t\t     << \"ctex:\" << ceiltex << \" \"\r\n\t\t     << \"light:\" << light << \" \"\r\n\t\t     << \"spec:\" << special << \" \"\r\n\t\t     << \"tag:\" << tag << \"\\n\";\r\n\t}\r\n} sectorA, sectorB;\r\nint main(int argc, char** argv)\r\n{\r\n\tif (argc < 3) { std::cout << \"usage: \" << argv[0] << \" SECTORS1.lmp SECTORS2.lmp\\n\"; return 1; }\r\n\tifstream fileA(argv[1]), fileB(argv[2]);\r\n\tbool endA = false, endB = false;\r\n\tfor (int i = 0; !(endA && endB); ++i)\r\n\t{\r\n\t\tif (fileA.peek() == EOF) endA = true;\r\n\t\telse fileA.read((char*)&sectorA, sizeof(Sector));\r\n\t\tif (fileB.peek() == EOF) endB = true;\r\n\t\telse fileB.read((char*)&sectorB, sizeof(Sector));\r\n\t\tif (memcmp(&sectorA, &sectorB, sizeof(Sector)))\r\n\t\t{\r\n\t\t\tif (!endA && !endB) {\r\n\t\t\t\tcout << \"<<< \"; sectorA.print(i);\r\n\t\t\t\tcout << \">>> \"; sectorB.print(i);\r\n\t\t\t}\r\n\t\t\telse if (endB) { cout << \"--- \"; sectorA.print(i); }\r\n\t\t\telse if (endA) { cout << \"+++ \"; sectorB.print(i); }\r\n\t\t\tcout << \"\\n\";\r\n\t\t}\r\n\t}\r\n\treturn 0;\r\n}"}