The code, so people don't have to download it themselves:
Code:
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
int main(int argc, char *argv[])
{
int nos = 0; // Number of strings
int nsc = 0; // Number of strings counted
string nui = ""; // Collection of all strings
++nsc; // When a string is added to nui add 1 to nsc
string ui; // Users input
cout << "Type something" << endl;
while ((nos > nsc) && ui += nui) // While nos > nsc and ui has another word to add to the nui
{ // continue checking for new strings in ui if ui += nui it partialy works.
cin >> ui; // Users Input
++nos; // add +1 to nos for each word input
ui += nui; // add new word to nui
}
// Print out the results
cout << "You typed - " << nui << " - and it had - " << nsc << " - words in it." << endl;
system("PAUSE");
return EXIT_SUCCESS;
}
Vague questions rarely get good answers.