to get a whole line instead of cin >> line; which only gets the first word use this getline(cin, line); this gets the whole line =p
and as far as a word count you can do something like this:
1 2 3
unsignedint num = 1;
for(unsignedint i = 0; i<str.size(); i++) if(str[i] == ' ') num++;
cout << "Word count is: " << num << endl;
You mean only read in the first three words?
you would have to modify the other code I gave you so that after num reaches 3 it stops reading it but im pretty tired so gl.