!!!
It is very important to note that the OJ does not support file operations.
Please manually check whether your program’s output matches the five provided test cases.
After you finish writing your code, make sure to upload it to the OJ. I will download the latest submission for grading.
OJ無法支援file用法,請自行檢查給予的五筆測資和你程式的輸出有沒有相同,寫完後請務必上傳到OJ,我會抓最新的上傳下來批改
!!!
This program compares two text files line by line.
Each line contains at most m characters, and the filenames have a maximum length of n.
The program reads two filenames as input, then opens both files and compares their contents one line at a time.
The filename of the file with more lines.
The number of extra remaining lines in that file.
Line numbers start from 0.
Here are the test files. Please copy and paste them into NotePad and save them as files. Make sure the file names match the ones specified by the OJ exactly.
以下為程式所需比較的file原始內容,請複製貼上到記事本中並存檔,檔名必須要和OJ規範一模一樣。
Sample 1 files
fileA_0.txt :
Tralalero Tralala Trippi Troppi Tung Tung Tung Sahur Ballerina Cappuccina Boneca Ambalabu
fileB_0.txt :
Tralalero Tralala Bombardiro Crocodilo Tung Tung Tung Sahur Ballerina Cappuccina Chimpanzini Bananini Lirili Larila Brr Brr Patapim
Sample 2 files
fileA_1.txt :
A B C
fileB_1.txt :
A B
Sample 3 files
fileA_2.txt :
114514 000 1919810
fileB_2.txt :
114514 111
Sample 4 files
fileA_3.txt :
ch4zi Jt2UPKyRzTUanSokhMqdF744cxEyCphSWHHKQciJzPzKJD18 KaRTn22lDdZl2 A4wHMsW4 FHpPZLWBxc8TUVmhjZPyKPZ A4oMIWxxMSaDfpUc
fileB_3.txt :
aWy1b9tGkCH JA2ex F1Dxh1E2O1d7KICEUOdYKgr5SoWGW2IwF6nAfEIbbOT1AGVmAEEHZqeor68gCEXdxkb rQB22Cta7EmzKaPll8DSwM3THjM42w4f0lnEsCsEJc49w yuAi4Sq5KZX
Sample 5 files
fileA_4.txt :
1Li SZjcsBKE0mK1XZO 8sSGxJcG9kA9YfrghmYDKOhV6wb1kGFEyrRgDi sEDUQgPhtxuzttK0dpmQ6k1LbJJ8QCrknPx4KQc0Bzj aAI 1L5N5
fileB_4.txt :
ABqnd5eYuNHFeIWbKHwK vIKg9QTdriqIW9va8ShMoH9VMuCNqKcn6iDI7MkQykL
Two strings, each representing a filename.
Filename length n ≤ 80 characters.
Each line in the file m ≤ 80 characters.
Zero or more integers indicating the line numbers where the two files differ.
If one file contains additional lines after the other ends, output:
<filename> <extra_line_count>