If you are using strings, you could use .find()/.substr() and try to find a space then four letters then another space (unless it is the first word or last word). You could try iterating through all 6 letter substrings (5 for the first/last) and look for spaces on the ends, then use .replace().
I think, you should have a close look on your if-else statements. For example, what does this mean?
if(text[i] == ' ' && text[i] != ',')
Also rethink on wich position the integers letterOne and letterTwo are. I would say line 37 has to be
letterOne=i+1
to be on the first letter of the new word. And with this the condition in line 25 is
(letterTwo - letterOne) == 4
And in the end, your attempt of re-running the program doesn't work, because cin leaves a newline in the buffer. After cin you have got to type something like cin.ignore(1000, '\n');