PROGRAMMING:String segmentation and splicing
Many people complain that strings in C are too difficult to use and that their interfaces are too old. For example, string segmentation (strtok), link (strcat). This time, we'll implement the more modern interfaces split and join ourselves.
The function split accepts the separator C, which can split the string into several arrays with the character P, such as "ABC". If the string is split with 'B', it will become an array ["a", "," "C"], and if the string is divided with 'C', it will become ["ABB", "".
The function join accepts the connection string s and connects the elements in a string array to form a new string. For example, ["I", "U"] if you link with the string "love", you will get "I love u"; There is only one element in ["ABC"], so no matter what connection you use, you always get "ABC" itself.
**Note: string operations built into the programming language are not allowed. Such as strtok and strcat in C, split and join in Java and python**
###Input format:
The input contains two lines.
The first line is the original string, the length of which is no more than $$10 ^ 3 $$, and the last line feed does not need to be read in. The input to this line may contain spaces, tabs.
The second line is the split character P and the connection string s in turn. Let's assume that P is not a space, tab, or newline. All characters after P and a space (which may include spaces, tabs, and not newlines) belong to the connection string s.
###Output format:
The output of the first line uses the string array separated by P. the string is surrounded by double quotation marks and separated by commas and spaces. There should be left and right brackets before and after the array to end with a new line.
The second line outputs a string split by P and then linked by s, ending with a new line.
###Input example:
```in
abbc
b x y
```
###Output example:
```out
["a", "", "c"]
a x y x y c
```
answer:If there is no answer, please comment
The function split accepts the separator C, which can split the string into several arrays with the character P, such as "ABC". If the string is split with 'B', it will become an array ["a", "," "C"], and if the string is divided with 'C', it will become ["ABB", "".
The function join accepts the connection string s and connects the elements in a string array to form a new string. For example, ["I", "U"] if you link with the string "love", you will get "I love u"; There is only one element in ["ABC"], so no matter what connection you use, you always get "ABC" itself.
**Note: string operations built into the programming language are not allowed. Such as strtok and strcat in C, split and join in Java and python**
###Input format:
The input contains two lines.
The first line is the original string, the length of which is no more than $$10 ^ 3 $$, and the last line feed does not need to be read in. The input to this line may contain spaces, tabs.
The second line is the split character P and the connection string s in turn. Let's assume that P is not a space, tab, or newline. All characters after P and a space (which may include spaces, tabs, and not newlines) belong to the connection string s.
###Output format:
The output of the first line uses the string array separated by P. the string is surrounded by double quotation marks and separated by commas and spaces. There should be left and right brackets before and after the array to end with a new line.
The second line outputs a string split by P and then linked by s, ending with a new line.
###Input example:
```in
abbc
b x y
```
###Output example:
```out
["a", "", "c"]
a x y x y c
```
answer:If there is no answer, please comment