按字母顺序移动单词中的字母
我目前正在进行一个项目,涉及移动单词中的字母并进一步研究所有可能的结果。
它应该像这样工作: 例如:
你好世界 ifmmpxpsme jgnnqyqtnf
...等等。 由于我是编程新手,并且对这个问题很困惑,有人可以给我一个关于如何成功管理这个问题的提示吗?我知道这不会那么困难,而且可能与 ASCII 字母表示有关,但是,我不知道如何执行此操作。预先感谢您的帮助。
I'm currently working a project involving shifting letters in a word and further working with all possible outcomes.
It should work like this:
e.g:
helloworld
ifmmpxpsme
jgnnqyqtnf
...and so on.
Since I'm new to programming and quite stuck on this matter, could anyone please give me a hint on how to successfully manage just that ? I know it can't be that difficult and it maybe has something to do with ASCII letter representation, however, I don't know, how to perform this. Thanks in advance for your kind help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该尝试阅读这个网站,它非常清楚地显示了 ASCII 表。
在 ASCII 中,每个字符都有其自己的唯一值,例如
'T'
等于84
,'t'
等于116
。因此,如果我们将+1
添加到它们中,它将分别变为'S'
和's'
,并且的逻辑相同 - 1.
.代码
输出:
You should try reading this site, it shows the ASCII table very clearly.
In ASCII very character was its own unique value for example
'T'
is equal to84
and't'
is equal to116
. So, if we add+1
to them it will become'S'
and's'
respectively and same logic goes for-1
.Code
Output: