An offer has been given. Print all its characters preceding the first comma. If there are no commas in the sentence, then output the entire sentence.
Solve the problem
without using the built-in string functions, except for a function that returns the length of a string.
Input: The first line is the original sentence.
Output: you need to print all the characters of the sentence that precede the first comma, if there are no commas, print the entire sentence
Input and output example
Test number |
Input |
Output |
1 |
fore, s t.
|
fore |
2 |
fore s t. |
fore s t. |
Запрещенные операторы:find