当前位置:网站首页>C191:密码编译
C191:密码编译
2022-07-27 17:17:00 【千干】
问题描述:
有一行电文,已按照下面的规律译成密码:
A>>Z a>>z
B>>Y b>>y
C>>X c>>x
. .
. .
. .
等等。即第1个字母变成第26个字母,第i个字母变成第(26-i+1)个字母,非字母字符不变,要求编程序将密码译成原文。
输入说明:
输入一串字符(包含7个元素),表示密码。
输出说明:
输出其对应的字符(包含7个元素),表示原文。
输入样例:
ABCDEFG
输出样例:
ZYXWVUT
#include<stdio.h>
int main()
{
char m[7];
int i;
scanf("%s",m);
for(i=0;i<7;i++)
{
if(m[i]>='A'&&m[i]<='Z')
{
m[i]='A'+26-(m[i]-'A'+1);
}
else if(m[i]>='a'&&m[i]<='z')
{
m[i]='a'+26-(m[i]-'a'+1);
}
}
for(i=0;i<7;i++) printf("%c",m[i]);
return 0;
}
边栏推荐
- Publish your own NPM component library
- 10.31静态路由的扩展配置
- 【深度学习基础知识 - 50】PCA降维 主成成分分析
- UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xff in position 0: invalid start byte
- BroadcastReceiver(广播)
- [basic knowledge of deep learning - 43] concept of odds ratio
- What's new in helix QAC 2022.2, the ace code static testing tool (1)
- rxbinding
- File operation protection
- [basic knowledge of deep learning - 38] the difference between L1 regularization and L2 regularization
猜你喜欢
随机推荐
SumMenuDemo(子菜单)
10.31静态路由的扩展配置
注入攻击
发布自己的npm组件库
Dry goods of technical practice | preliminary exploration of large-scale gbdt training
Matplotlib(基本用法)
Samsung will promote a number of risc-v architecture chips, and 5g millimeter wave RF chips will be the first to be adopted
访问控制
MySQL time zone problem
Intel releases horse ridge chip: 22nm process, which can control multiple qubits
归一化(Normalization)和标准化(Standardization)
Turn Hyper-V on and off
[RCTF2015]EasySQL-1|SQL注入
RadioGroup(单选框)
[basic knowledge of deep learning - 37] solve the imbalance between positive and negative samples
[basic knowledge of deep learning - 42] detailed explanation of logistic regression
Broadcastreceiver (broadcast)
二叉搜索树
[basic knowledge of deep learning - 49] kmeans
Hyperledger caliper is built on fabric for performance test









