Code Wars II
Danger Level: Blue Cruiser
Point Value: 6
A classic word sort problem with a special bonus!
The input file PROB10.IN will contain several lines of text. For example:
Santa, you just better watch your step!
How much is that doggie in the window?
The quick brown fox jumped over the lazy dog.
Have you read Knuth's programming series?
It just doesn't get any better than this!
The program should sort the words on each line and print them to the output file, PROB10.OUT, like this:
better just Santa step watch you your
doggie How in is much that the window
brown dog fox jumped lazy over The the quick
Have Knuth's programming read series you
any better doesn't get It just than this
1 POINT BONUS: Count the number
of occurrences of each word in the entire file and print the list at the
end of the output file, sorted in alphabetical order. (Sample output
is in columns, yours shouldn't).