AtCoder Beginner Contest 168
翻译中…
Problem Statement
翻译中…
We have a string $S$ consisting of lowercase English letters.
翻译中…
If the length of $S$ is at most $K$, print $S$ without change.
翻译中…
If the length of $S$ exceeds $K$, extract the first $K$ characters in $S$, append ... to the end of them, and print the result.
翻译中…
Constraints
翻译中…
$K$is an integer between$1$and$100$(inclusive).$S$is a string consisting of lowercase English letters.- The length of
$S$is between$1$and$100$(inclusive).
翻译中…
Input
翻译中…
Input is given from Standard Input in the following format:
翻译中…
K
S
翻译中…
Output
翻译中…
Print a string as stated in Problem Statement.
翻译中…
样例
Input #1
7
nikoandsolstice
Output #1
nikoand...
`nikoandsolstice` has a length of $15$, which exceeds $K=7$.
We should extract the first $7$ characters in this string, append `...` to the end of them, and print the result `nikoand...`.
Input #2
40
ferelibenterhominesidquodvoluntcredunt
Output #2
ferelibenterhominesidquodvoluntcredunt
The famous quote from Gaius Julius Caesar.
题目信息
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。