Pergunta de entrevista da empresa Microsoft

Write a function that would count the number of words in a sentence.