Translate a string into morse code.
Your task is to write a program that takes a string as input and translates it into its equivalent in international Morse code. The input will be a string of lowercase space-separated words where each word consists of nothing but the letters a-z. Add spaces between the words but not between the letters of a word in morse code. Here is the alphabet in morse code:
a: .- g: --. m: -- s: ... y: -.--
b: -... h: .... n: -. t: - z: --..
c: -.-. i: .. o: --- u: ..-
d: -.. j: .--- p: .--. v: ...-
e: . k: -.- q: --.- w: .--
f: ..-. l: .-.. r: .-. x: -..-
For example, the string
lorem ipsum
should be translated to
.-..---.-..-- ...--......---
# | Size | % | Users |
---|---|---|---|
#1 | 101 c. | Top 7% | |
#2 | 102 c. | Top 13% | |
#3 | 113 c. | Top 20% | |
#4 | 124 c. | Top 27% | |
#5 | 133 c. | Top 33% | |
#6 | 136 c. | Top 40% | |
#7 | 139 c. | Top 47% | |
#8 | 145 c. | Top 53% | |
#9 | 146 c. | Top 60% | |
#10 | 150 c. | Top 67% | |
#11 | 170 c. | Top 73% | |
#12 | 172 c. | Top 80% | |
#13 | 174 c. | Top 87% | |
#14 | 195 c. | Top 93% | |
#15 | 219 c. | Top 100% |