Driver code
int main ( ) { string s [ ] = { " hate " , " love " , " peace " , " love " , " peace " , " hate " , " love " , " peace " , " love " , " peace " } ; int n = sizeof ( s ) / sizeof ( s [ 0 ] ) ; cout << countWords ( s , n ) ; return 0 ; }