当前位置:网站首页>N – simple encoding
N – simple encoding
2022-06-25 07:14:00 【Python's path to becoming a God】
Description
Translate a string of text into a password , The law of passwords is :
Translate all the original lower case letters into upper case letters , All uppercase letters are translated into lowercase letters , The translation rules of numbers are as follows :
0——>9
1——>8
2——>7
3——>6
4——>5
5——>4
6——>3
7——>2
8——>1
9——>0
Then reverse the order of all the characters .
Input
Enter a string of text , The maximum number of characters does not exceed 100.
Output
Output the encoded result .
Sample
Input
china
Output
ANIHC
Hint
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
int main(){
char code[101];
int l, i;
scanf("%s", code);
l = strlen(code);
for(i = 0; i < l; i++){
if(code[i] >= 'A' && code[i] <= 'Z'){
code[i] += 32;
}
else if(code[i] >= 'a' && code[i] <= 'z'){
code[i] -= 32;
}
else if(code[i] >= '0' && code[i] <= '9'){
code[i] = 105 - code[i];
}
}
for(i = l - 1; i >=0; i--){
printf("%c", code[i]);
}
printf("\n");
return 0;
}
边栏推荐
- Make enough money to go back home
- The Rust Programming Language
- MySQL(十二)——更改表的备注
- Flask 的入门级使用
- 3632. Binary sum
- What is the real future of hardware engineers?
- Make fertilizer Safi from crop residues locally to increase yield by 30% and improve soil
- [Shangshui Shuo series] day 5
- Query JSON data in MySQL table
- Fastadmin cascade clear data
猜你喜欢

CTFHub-Web-信息泄露-目錄遍曆

Ppt template of small fresh open class education courseware

基于 KubeSphere 的分级管理实践

【xxl-job】池塘水绿风微暖,记得玉真初见面

Kubernetes 集群中流量暴露的几种方案

In depth analysis of Apache bookkeeper series: Part 3 - reading principle

终于等到你,小程序开源啦~

Understand ZBrush carving software and game modeling analysis

ES can finally find brother Wukong!
![Analysis on the scale of China's smart airport industry in 2020: there is still a large space for competition in the market [figure]](/img/cd/c8be09eca7b41407b0ca1f3b4f3fe8.jpg)
Analysis on the scale of China's smart airport industry in 2020: there is still a large space for competition in the market [figure]
随机推荐
[learn FPGA programming from scratch -43]: vision chapter - technology evolution of chip design in the post Moore era -2- evolution direction
lotus v1.16.0-rc2 Calibration-net
How do I create a guid in excel- How to create a GUID in Excel?
【2022黑马程序员】SQL优化
Atomic alpha development board -- SD card and EMMC burning tool
313. Binary sum
深入解析 Apache BookKeeper 系列:第三篇——读取原理
Americo technology launches professional desktop video editing solution
48 pictures | teach you the performance monitoring, pressure testing and tuning of microservices by hand
Simple and complete steps of vivado project
弱大数定理的意义与证明
活动报名|Apache Pulsar x KubeSphere 在线 Meetup 火热来袭
赚够钱回老家吗
Escape analysis of 982 golang
The significance and proof of weak large number theorem
哇哦,好丰富呀。
CTFHub-Web-信息泄露-目录遍历
Keil debug view variable prompt not in scope
Lotus v1.16.0-rc2 Calibration net
How to store the directory / hierarchy / tree structure in the database- How to store directory / hierarchy / tree structure in the database?