object ReverseEachWord {
def reverseEachWordInString(s: String): String = {
val words = s.split(" ")
val reversedWords = words.map(word => word.reverse)
reversedWords.mkString(" ")
}
def main(args: Array[String]): Unit = {
val s = "scala java c++ rust python c#"
println(reverseEachWordInString(s))
}
}
/*
run:
alacs avaj ++c tsur nohtyp #c
*/