|
|
@ -7,9 +7,21 @@ const char* SEPARATORS = " \r\n,.!?:;()-";
|
|
|
|
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
int main() {
|
|
|
|
char text[MAX_SIZE] = {0};
|
|
|
|
char text[MAX_SIZE] = {0};
|
|
|
|
|
|
|
|
|
|
|
|
std::cout << "Enter the line: ";
|
|
|
|
std::cout << "Enter the line: ";
|
|
|
|
fgets(text, MAX_SIZE, stdin);
|
|
|
|
fgets(text, MAX_SIZE, stdin);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const char* start = text;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while (true) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
size_t separator_count = strspn(start, SEPARATORS);
|
|
|
|
|
|
|
|
start += separator_count;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (start[0] == '\0')
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|