Ok, so you can read a line of text into a string using getline().
Once you have the string, you can either use the find() method or write your own loop to look for spaces/punctuation that would end a word. You can use s[x] to access individual characters of the string s (where x is the index, 0-based).
Keep two variables -- a count of the number of vowels you've seen and a string which is initially blank.
As you read each character of the sentence, if the character is non-blank, add the character to your string variable. Also, if the character is a vowel, add 1 to your counter.
Once you hit the end of the word, check to see if your count is at least 3. If it is, write your string variable to the file. Then reset the counter to zero and reset the string variable to blank.
Continue doing this until you've reached the end of the sentence.
Something like this pseudo-code:
1 2 3 4 5 6 7 8 9 10 11 12
|
read_sentence_into_string_s;
string word;
int count;
for( index = 0; index < length-of-s; ++index )
if( s[ index ] is non-blank )
add s[ index ] to end of word;
if( s[ index ] is a vowel )
add 1 to count;
else
if( count is at least 3 )
write word to file;
reset count and word
|