Write a program to count occurrences(出现次数) of each different word in a file, sort according to the description, and write the result to another file. Filenames are specified in the command line. 1、Format of the command line: cmd inputFile outputFile 2、Sorting criteria: from most frequent word to rare one. If two words have same occurrences, they are outputted in lexicographical order. 3、Input file size limitation: 10K 4、Output file format: “word: occurrences” for each word in each line For example: an input file a.txt : ass sdwd ssd ssda wqw ass ass as a aa a a aa a a a command line: cmd a.txt b.txt b.txt: a: 6 ass: 3 aa: 2 as: 1 sdwd: 1 ssd: 1 ssda: 1 wqw: 1
文件上机综合题Write a program to count occurrences(出现次数) of each different word in a file, sort according to the description, and write the result to another file. Filenames are specified in the command line.1、Format of the command line: cmd inputFile out