当前位置:网站首页>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
边栏推荐
- The practice of event driven architecture in vivo content platform
- 什么是EC鼓风机(ec blower fan)?
- Drawing animated bubble chart with R language
- What should I do if the version is incompatible with the jar package conflict?
- R language ggmap visual cluster
- HJ质数因子
- 实时数据库 - 笔记
- 股票炒股注册开户靠谱吗?安全吗?
- Analyze 5 indicators of NFT project
- What is EC blower fan?
猜你喜欢

PLC -- 笔记

2021 programming language ranking summary

Section VI UART of zynq

A gadget can write crawlers faster

Jetpack - defects of livedata component and Countermeasures

Hack the box:routerspace

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

es6箭头函数中return的用法

kubernetes部署thanos ruler的发送重复告警的一个隐秘的坑

扩展Prometheus的解决方案thanos的简介和几个月使用心得
随机推荐
vite2.9 中指定路径别名
R 语言 ggmap
Self discipline challenge 30 days
DBeaver 22.1.1 发布,可视化数据库管理平台
ES6 use of return in arrow function
Redis implements distributed locks
Implementation of commit message standardized control in large projects
云原生:云计算技术再次升级 开启全面云开发时代
Sentinel mechanism of redis cluster
The practice of traffic and data isolation in vivo Reviews
hack the box:RouterSpace题解
R语言绘制 ggplot2 季节性图
Uninstall and reinstall the latest version of MySQL database. The test is valid
R 和 rgl 绘制 3D 结
Principle and practice of bytecode reference detection
打新债注册开户靠谱吗?安全吗?
云原生(待更新)
R language ggmap
mysql57 zip文件安装
Section VI UART of zynq