я сдлелал так, незнаю как удалить повторившееся слово...
Код
#pragma once
#include<iostream>
#include<conio.h>
#include<fstream>
using namespace std;
#define SIZE 80
void main()
{
char str[SIZE] = {"mom topor tor tor"};
/*cout << "Enter string: ";
cin.getline(str, SIZE-1);*/
cout << str << endl;
char *p1, *p2, pst;
p1 = str;
p2 = str;
while(*p2!=' ') p2++;
pst = ++p2;
do{
if(*p1 != *p2){
p1 = pst;
while(*p2!=' ') p2++;
pst = ++p2;
}
if(*p1 == *p2){
p1++;
p2++;
if((*p1 = ' ') && (*p2 == ' ')){[b]..???..[/b]}
}
_getch();
}