My nearly six year old daughter has heard her fair share of bad words and at one point started to repeat them as well. I explained to her the difference between bad words and good words. She knows piss and pee mean the same thing etc but if she says the bad one, it will make people upset and think her very uncute.
Once, when I dropped a pair of scissors point down on my foot and let some choice words fly, she pointed out that I said bad words and asked why I could say them but she couldn't. In pain, I tersely replied, "These are adult words and you can say them when you're 18." It was a quick explanation that she accepted, thank goodness. I have never heard her repeat any other curse words, except shortly after hearing this explanation, she excitedly told her daddy when he came home from work that day, "When I'm 18 I can say piss instead of pee!!" and I had to run to the other room so she couldn't hear me laughing.
Later that month we were visiting my parents when she herd my father curse at the TV and she called him on it. "You said a bad word!", she sang out. I thought I'd test her and asked her what bad word grandpa said. She almost tripped up and repeated it but then caught herself and instead replied, "You know what one it was!!"
Good girl.