Ответ:
#include
#include
#include
using namespace std;
char* delItem(char* str, size_t n)
{
int len = strlen(str)-n;
if(len>0)
memmove(str+n, str+n+1, len);
return str;
}
int main()
{
list words;
int maxL = 0;
char st[] = "fdfd hgf jhgf.jhgf,jytf juyhg1fhgft jhgf hgfhgfh hgfhgf";
char razd[] = " ,.";
for (char *p = strtok(st, razd); p != NULL; p = strtok(NULL, razd))
{
words.push_back(p);
if(maxL < strlen(p))
maxL = strlen(p);
}
for (char* n : words)
{
if(strlen(n) == maxL)
{
if(strlen(n)%2 == 0)
{
int delIndex = strlen(n)/2-1;
for(int i=0; i<2; i++)</p>
n = delItem(n,delIndex);
}
else
{
n=delItem(n,int(strlen(n)/2));
}
}
cout<<n<<endl;</p>
}
system("PAUSE");
}
Объяснение: