写一个Python函数，将给定的字符串中的每个单词首字母大写。
字符串: "hello world! welcome to GPT"
```python
def capitalize_words(text):
    return " ".join([word.capitalize() for word in text.split()])
    
text = "hello world! welcome to GPT"
print(capitalize_words(text))  # 输出："Hello World! Welcome To Gpt"
```