#include <iostream>
#include <string>
using namespace std;
int main()
{
string s("cpp c csharp python java");
string word, max = "", min = s;
for (size_t i = 0; i < s.length(); i++)
{
if (s[i] != ' ')
{
word += s[i];
}
else
{
if (word.length() < min.length())
min = word;
if (word.length() > max.length())
max = word;
word = "";
}
}
cout << "The largest word is: " << max << endl;
cout << "The smallest word is: " << min << endl;
return 0;
}
/*
run:
The largest word is: csharp
The smallest word is: c
*/