Reverse Words In A String

cpp and java version