#280. 字符串首尾N字符拼接

    ID: 280 Type: Default 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>codingbatString-1gesp3字符串

字符串首尾N字符拼接

String First Last N Chars

Background

Dawei is studying string processing and encountered an interesting problem.

Problem Description

Given a string ss and an integer nn, return a new string made of the first nn characters and the last nn characters from the original string. The string length will be at least nn.

Input Format

Input is given from standard input in the following format.

A string ss. An integer nn.

Output Format

Output is printed to standard output in the following format.

A new string, formed by concatenating the first nn characters and the last nn characters of the original string.

Sample

Hello
2
Helo
Chocolate
3
Choate
Chocolate
1
Ce

Sample Explanation

For the first sample, the first 2 characters of "Hello" are "He\