Bài tập
Nhiệm vụ của bạn là chuyển đổi một văn bản thành chính tả thời trung cổ.
Chi tiết
j
được chuyển đổi thànhi
vàJ
sangI
.u
vàU
ở đầu từ được chuyển đổi thànhv
vàV
tương ứng.v
vàV
tại bất cứ nơi nào ngoại trừ phần đầu của từ được chuyển đổi thànhu
vàU
tương ứng.s
được chuyển đổi thànhſ
(U + 017F) trừ khi ở cuối từ hoặc đứng trước từ khács
.
Thông số kỹ thuật
- Một từ được định nghĩa là một chuỗi các chữ cái trong
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
. - Tất cả các từ sẽ có ít nhất hai chữ cái.
- Đầu vào sẽ chỉ bao gồm các ký tự ASCII có thể in (U + 0020 - U + 007E).
- Sẽ không có sự xuất hiện của hơn hai lần liên tiếp
s
. Đó là,sss
sẽ không phải là một chuỗi con của đầu vào.
Tủ thử
Lời nói cá nhân:
Input Output
------------------------
Joy Ioy
joy ioy
Universe Vniuerſe
universe vniuerſe
Success Succeſs
successfull ſucceſsfull
Supervise Superuiſe
supervise ſuperuiſe
Super-vise Super-viſe
I've I've
majors maiors
UNIVERSE VNIUERSE
0universe 0vniuerſe
0verify 0verify
I0ve I0ve
_UU_ _VU_
_VV_ _VU_
ss_ ſs_
Toàn bộ đoạn văn:
Input: Christian Reader, I have for thy use collected this small Concordance, with no small labour. For being to comprise much in little roome, I was to make choyse of the most principall and usefull places, and to rank them under such words as I thought most essentiall and materiall in the sentence, because the scant roome allotted unto me, would not permit that I should expresse them under every word in the verse, as it is the manner in large Concordances.
Output: Chriſtian Reader, I haue for thy vſe collected this ſmall Concordance, with no ſmall labour. For being to compriſe much in little roome, I was to make choyſe of the moſt principall and vſefull places, and to rank them vnder ſuch words as I thought moſt eſsentiall and materiall in the ſentence, becauſe the ſcant roome allotted vnto me, would not permit that I ſhould expreſse them vnder euery word in the verſe, as it is the manner in large Concordances.
Hàm băm SHA-256 của đầu ra của testcase cuối cùng là:
5641899e7d55e6d1fc6e9aa4804f2710e883146bac0e757308afc58521621644
Khước từ
Chỉnh hình Medievall không phải là contante. Xin đừng phàn nàn nếu bạn hãy tìm những cuốn sách cũ với một hình chữ nhật khác.
ſ
là 1 byte không?
Super-vise
trở thành Super-viſe
?