#245. 字符串前缀重复拼接
字符串前缀重复拼接
String Front Copies
Background
Congcong is currently learning about string manipulation. He encountered an interesting problem that requires copying a string's front multiple times.
Problem Description
Given a string and a non-negative integer , we define the "front" of the string as the first 3 characters. If the string's length is less than 3, the front is the string itself. Return copies of this front.
Input Format
Input is given from Standard Input in the following format.
Output Format
Output is printed to Standard Output in the following format.
A string, representing copies of the front.
Sample
Chocolate
2
ChoCho
Chocolate
3
ChoChoCho
Abc
3
AbcAbcAbc
Sample Explanation
For the first sample, the string is "Chocolate\