#311. 字符串重复与连接

    ID: 311 Type: Default 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>codingbatString-2gesp3字符串循环结构

字符串重复与连接

String Repetition and Concatenation

Background

Problem Description

Given two strings, word and a separator sep, return a big string made of count occurrences of the word, separated by the sep string.

Input Format

The input consists of a single line string, representing word and sep, separated by the literal string " ".

word" "sep

Output Format

Output a single string, which is word repeated count times, separated by sep.

result_string

Sample

Word" "X"
"WordXWordXWord"
This" "And"
"ThisAndThis"
This" "And"
"This"

Sample Explanation

In Sample 1, word is "Word" and sep is "X". The output is "WordXWordXWord\