CodeWars:Decode the Morse code

该博客介绍了如何编写一个简单的摩尔斯电码解码器。摩尔斯电码是一种字符编码方式,由点和划组成,尽管现在已被语音和数字数据通信取代,但仍有一些应用。任务是实现一个函数,接收摩尔斯电码输入并返回人类可读的字符串。测试字符串包含有效的摩尔斯电码,所以无需错误检查。完成此任务后,可以尝试更高级的摩尔斯电码解码挑战。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Part of Series 1/3

This kata is part of a series on the Morse code. After you solve this kata, you may move to the next one.


In this kata you have to write a simple Morse code decoder. While the Morse code is now mostly superceded by voice and digital data communication channels, it still has its use in some applications around the world.

 

The Morse code encodes every character as a sequence of "dots" and "dashes". For example, the letter A is coded as ·−, letter Q is coded as −−·−, and digit 1 is coded as ·−−−−. The Morse code is case-insensitive, traditionally capital letters are used. When the message is written in Morse code, a single space is

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值