Your logic itself seems to be wrong.
There are a lot of loopholes.
First of all you are not saving the longest and the shortest words.
Quote:
if (y.at(i)==32)
{number=0;}
|
In the above if statement you have to save the words. You should also have variables for saving the longest word count and the shortest word count.
You must be learning c++ right?
Get a good book. There are a lot of books available for free on the net.
Hope I'm not offending you.