题目连结:https://rosalind.info/problems/ini3/
给一长串的字串资料,然后a, b, c, d 4个数字
需切出字串[ab]、字串[cd]的位置,连接后印出来
(须包含字串[b]、字串[d]的位置)
输入
HumptyDumptysatonawallHumptyDumptyhadagreatfallAlltheKingshorsesandalltheKingsmenCouldntputHumptyDumptyinhisplaceagain.
22 27 97 102
输出
Humpty Dumpty
程式码:
s = "HumptyDumptysatonawallHumptyDumptyhadagreatfallAlltheKingshorsesandalltheKingsmenCouldntputHumptyDumptyinhisplaceagain"
a, b, c, d = 22, 27, 97, 102
# a, b, c, d = map(int, input().split()) # 开启手动输入数字
print(s[a:b+1], s[c:d+1])