分析文章中每一單字出現之次數,並按出現次數之高低,依序列印出所有單字及其出現次數(註:單字由空格、逗號、句號或換行等字符分開)
說明:輸入一篇文章(字數可能多於256字),分析文章中每一單字出現之次數,並按出現次數之高低,依序列印出所有單字及其出現次數。
以下列文章測試之
MACHINE LANGUAGE IS THE BASIC LANGUAGE UNDERSTOOD BY THE COMPUTING MACHINE. MOST COMPUTERS HAVE REGISTERS IN THE CPU THAT ARE SIMILAR TO THE REGISTER IN THE DESK CALCULATOR. THEY ARE CAKKED ACCUMULATORS BECAUSE THEY ARE USED TO ACCUMULATE THE INTERMEDIATE RESULTS.
THE CPU CAN BE TOLD TO LOAD A NUMBER INTO ITS ACCUMULATOR FROM A SPECIFIC CELL IN THE MEMORY, TO ADD, SUBTRACT, MULTIPLY, OR DIVIDE THE NUMBER IN THE ACCUMULATOR BY A NUMBER FROM MEMORY, OR TO STORE A NUMBER FROM THE ACCUMULATOR INTO MEMORY.