#abc219b. B - Maritozzo
B - Maritozzo
Score : points
问题描述
你将得到三个由小写英文字母组成的字符串 ,以及一个由字符 1
, 2
, 3
组成的字符串 。
根据 中的字符顺序拼接这三个字符串,并输出结果字符串。具体规则如下:
- 对于满足 的每个整数 ,定义字符串 如下:
- 若 的第 个字符为
1
,则 ; - 若 的第 个字符为
2
,则 ; - 若 的第 个字符为
3
,则 。
- 若 的第 个字符为
- 按照顺序拼接字符串 并打印出最终得到的字符串。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
You are given three strings consisting of lowercase English letters, and a string consisting of 1
, 2
, 3
.
Concatenate the three strings according to the characters in and print the resulting string. Formally, conform to the following instructions.
- For each integer such that , let the string be defined as follows:
- , if the -th character of is
1
; - , if the -th character of is
2
; - , if the -th character of is
3
.
- , if the -th character of is
- Concatenate the strings in this order and print the resulting string.
Constraints
- , , and consist of lowercase English letters.
- consists of
1
,2
, and3
.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
mari
to
zzo
1321
Sample Output 1
marizzotomari
We have mari
, zzo
, to
, mari
. Concatenate these and print the resulting string: marizzotomari
.
Sample Input 2
abra
cad
abra
123
Sample Output 2
abracadabra
Sample Input 3
a
b
c
1
Sample Output 3
a
update @ 2024/3/10 09:40:32