#include #include #include const size_t MAX_SIZE = 256; const char* SEPARATORS = " \r\n,.!?:;()-"; int main() { char text[MAX_SIZE] = {0}; std::cout << "Enter the line: "; 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; } size_t word_length = strcspn(start, SEPARATORS); std::cout.write(start, word_length) << std::endl; start += word_length; } return 0; }