当前位置:网站首页>Hj21 simple password
Hj21 simple password
2022-06-28 07:37:00 【Courageous steak】
Knowledge point : character string simulation
describe
Now there is a cipher transformation algorithm .
The correspondence between numbers and letters on the nine key mobile phone keyboard : 1–1, abc–2, def–3, ghi–4, jkl–5, mno–6, pqrs–7, tuv–8 wxyz–9, 0–0, Change the lowercase letters in the password into the numbers corresponding to the nine key keyboard , Such as :a become 2,x become 9.
And the uppercase letters in the password become lowercase and then move back one bit , Such as :X , Change to lowercase first , One more step back , Turned into y , exception :Z Moving back is a .
Numbers and other symbols are not transformed .
Data range : The length of the input string meets the requirements 1≤n≤100
Input description :
Enter a set of passwords , Length not exceeding 100 Characters .
Output description :
Output the string after password transformation
Example 1
Input :YUANzhi1987
Output :zvbo9441987
Cattle guest HJ Python
# The elapsed time 42ms Take up memory 4700KB
# a:97 z:122 0: 49 9:57
s = input()
for i in s:
if ord(i) >= 97 and ord(i) <= 122:
if i in "abc":
print("2",end="")
if i in "def":
print("3",end="")
if i in "ghi":
print("4",end="")
if i in "jkl":
print("5",end="")
if i in "mno":
print("6",end="")
if i in "pqrs":
print("7",end="")
if i in "tuv":
print("8",end="")
if i in "wxyz":
print("9",end="")
elif ord(i) >= 65 and ord(i) < 90:
print(chr(ord(i.lower())+1),end="")
elif ord(i) == 90:
print("a",end="")
else:
print(i,end="")
Link to the original text :
https://www.920vip.net/article/184
边栏推荐
- 本周二晚19:00战码先锋第8期直播丨如何多方位参与OpenHarmony开源贡献
- pip 更新到最新的版本
- 股票炒股注册开户靠谱吗?安全吗?
- linux下修改mysql端口号
- DBeaver 22.1.1 发布,可视化数据库管理平台
- A gadget can write crawlers faster
- 8 figures | analyze Eureka's first synchronization registry
- kubernetes部署thanos ruler的发送重复告警的一个隐秘的坑
- 异或的应用。(提取出数字中最右侧的1,面试中经常用的到)
- Hash slot of rediscluster cluster cluster implementation principle
猜你喜欢

"Three routines" of digital collection market

Unity UI shadow component

ABAP 技能树

Evolution of vivo push platform architecture

kubelet垃圾(退出的容器和未使用的镜像)回收源码分析

mysql57 zip文件安装

Section 9: dual core startup of zynq

hack the box:RouterSpace题解

Jetpack - defects of livedata component and Countermeasures

linux下修改mysql端口号
随机推荐
In idea, the get and set methods may be popular because the Lombok plug-in is not installed
LLVM 与 Clang
Kubernetes deploys a secret pit where thanos ruler sends repeated alarms
Section VI UART of zynq
Leetcode learning records
Open62541 import nodeset file directly
Hash slot of rediscluster cluster cluster implementation principle
Kubernetes理论基础
R 和 rgl 绘制 3D 结
PLC -- 笔记
Mysql8.0和Mysql5.0访问jdbc连接
Solving the longest palindrome substring by dynamic programming
R language ggmap visual cluster
R language hitters data analysis
flex布局
Static resource compression reduces bandwidth pressure and increases access speed
Modifying MySQL user name root under Linux
Mysql57 zip file installation
Implementation of commit message standardized control in large projects
No suspense about the No. 1 Internet company overtime table