当前位置:网站首页>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
边栏推荐
- Design and implementation of spark offline development framework
- No suspense about the No. 1 Internet company overtime table
- Rediscluster cluster mode capacity expansion node
- Principle and practice of bytecode reference detection
- 阿里云服务器创建快照、回滚磁盘
- ABAP skill tree
- Recommended system series (Lecture 5): Optimization Practice of sorting model
- Safety training is the greatest benefit for employees! 2022 induction safety training for new employees
- Static resource compression reduces bandwidth pressure and increases access speed
- Uninstall and reinstall the latest version of MySQL database. The test is valid
猜你喜欢
数字藏品市场“三大套路”
以动态规划的方式求解最长回文子串
网传互联网公司加班表,排名第一的没悬念
看似简单的光耦电路,实际使用中应该注意些什么?
Principle and practice of bytecode reference detection
Application of XOR. (extract the rightmost 1 in the number, which is often used in interviews)
卸载重装最新版mysql数据库亲测有效
[ thanos源码分析系列 ]thanos query组件源码简析
Leetcode+ 51 - 55 retrospective and dynamic planning topics
Kubelet garbage collection (exiting containers and unused images) source code analysis
随机推荐
Llvm and clang
扩展Prometheus的解决方案thanos的简介和几个月使用心得
[ thanos源码分析系列 ]thanos query组件源码简析
ABAP 技能树
实时数据库 - 笔记
R language hitters data analysis
HJ21 简单密码
Recommended system series (Lecture 5): Optimization Practice of sorting model
自动化测试的生命周期是什么?
Flutter realizes the function of "shake"
HJ成绩排序
R 语言 ggmap 可视化集群
mysql57 zip文件安装
Source code analysis of kubernetes' process of deleting pod
Introduction and several months' experience of extending the solution thanos of Prometheus
DBeaver 22.1.1 发布,可视化数据库管理平台
Redis implements distributed locks
Section Xi. Axi of zynq_ Use of DMA
open62541直接导入NodeSet文件
Sword finger offer|: linked list (simple)