当前位置:网站首页>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
- Matplotlib(基本用法)
- OneNote code highlighting
- JS event listening mouse keyboard form page onclick onkeydown onchange
- Gesturedetector (gesture recognition)
- Dry goods of technical practice | preliminary exploration of large-scale gbdt training
- 顶级“黑客”能厉害到什么地步?无信号也能上网,专家:高端操作!
- vlan试验2021.1.14
- GridView (implement table display icon)
- go-zero单体服务使用泛型简化注册Handler路由
猜你喜欢

Release Samsung 3J1 sensor: the code implies that the safety of pixel 7 face recognition will be greatly increased

Hyperledger caliper is built on fabric for performance test

Complex number proof of solvability of regular 17 sided ruler and gauge drawing

Version announcement | Apache Doris 1.1 release version officially released!

Marqueetextview (running lantern)

下放三星3J1传感器:代码暗示Pixel 7人脸识别安全性将大增

GestureDetector(手势识别)

A low code development platform that brings high-value user experience

访问控制
![[basic knowledge of deep learning - 37] solve the imbalance between positive and negative samples](/img/71/4052607951eb52862a6fd36366f216.png)
[basic knowledge of deep learning - 37] solve the imbalance between positive and negative samples
随机推荐
[basic knowledge of deep learning - 50] PCA dimensionality reduction principal component analysis
dp(动态规划)
【深度学习基础知识 - 46】贝叶斯定理与条件概率公式
强化学习介绍
[basic knowledge of deep learning - 42] detailed explanation of logistic regression
focal loss
[basic knowledge of deep learning - 39] comparison of BN, LN and WN
[basic knowledge of deep learning - 38] the difference between L1 regularization and L2 regularization
AutoCompleteTextView (input box pre match)
AutoCompleteTextView(输入框预匹配)
Use of jvisualvm
ReferenceError: __ dirname is not defined in ES module scope
JS find all nodes sibling childNodes children
[basic knowledge of deep learning - 37] solve the imbalance between positive and negative samples
The first Xiaolong 765G! Redmi K30 5g release: support 5g dual-mode 120Hz screen, priced from 1999 yuan
Application pool has been disabled
11.5.OSPF
Binary search tree
[deep learning target detection series - 01] what is target detection
pytorch lstm+attention