1850: 字符串插入
Memory Limit:32 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:9
Solved:8
Description
输入一个主字符串、一个待插入的子字符串和一个整数pos(确保插入位置合法,从0开始),使用string的insert函数将子字符串插入到主字符串的pos位置,输出插入后的完整字符串。
比如输入"hello world" "my " 6,插入后为"hello my world",输出该字符串。
比如输入"hello world" "my " 6,插入后为"hello my world",输出该字符串。
Input
第一行输入主字符串,第二行输入待插入的子字符串,第三行输入整数pos。
Output
输出插入后的字符串。
Sample Input Copy
hello world
my
6
Sample Output Copy
hello my world
HINT
直接使用string的insert成员函数,参数为插入位置和待插入字符串~