#309. 字符串截取与重复
字符串截取与重复
String Repetition
Background
Congcong is currently studying string processing and has encountered an interesting problem that requires your help to solve.
Problem Description
Given a string and an integer , return a new string made of repetitions of the last characters of the original string. You may assume that is between and the length of the string, inclusive.
Input Format
The input is given from standard input in the following format:
The first line contains a string . The second line contains an integer .
Output Format
The output should be printed to standard output in the following format:
The resulting string.
Sample
Hello
3
llollollo
Hello
2
lolo
Hello
1
o
Sample Explanation
- Sample 1: The string is "Hello\