写一个程序，将一个字符串中的单词颠倒过来。


This is a test.
以下是Python的代码实现：

```python
sentence = "This is a test."
words = sentence.split()
reversed_words = [word[::-1] for word in words]
reversed_sentence = " ".join(reversed_words)

print(reversed_sentence)
```

输出结果为：

```
sihT si a tset.
```