当前位置:网站首页>Decipher password (comprehensive)
Decipher password (comprehensive)
2022-07-19 06:54:00 【winkiii】
describe
There's a man named “ Pig head Gang ” The country , Using a simple grammar encryption , The language they use is capital letters , There are no other characters ; Now we know that their encryption method is : Only one capital letter is used to XOR with the original text to generate ciphertext . Please help untie .
Input
There are several groups , Each group of inputs has 2 That's ok , The first line of integers N Express N A ciphertext , The next line is N The integers represent N A ciphertext .
Output
Output the original text with only capital letters .
sample input 1
30
17 6 9 8 3 0 1 6 7 4 5 10 11 8 9 14 15 12 13 18 19 16 17 22 23 20 21 26 27 24
sample output 1
SDKJABCDEFGHIJKLMNOPQRSTUVWXYZ
#include<stdio.h>
int main(){
int n,i,j,c;
int a[100];
int flag;
while(scanf("%d",&n)!=EOF){
for(i=0;i<n;i++){
scanf("%d",&a[i]);
}
for(j='A';j<='Z';j++){
flag = 1;
for(i=0;i<n;i++){
if((a[i]^j)<'A' || (a[i]^j)>'Z'){
flag = 0;
break;
}
}
if(flag){
c = j;
break;
}
}
for(i=0;i<n;i++){
printf("%c",(char)(a[i]^c));
}
printf("\n");
}
}
边栏推荐
- STM32 serial communication related learning
- OLED data display based on spi/iic interface
- Get the first and last values after Oracle grouping and sorting
- Application case of CS brand SD NAND in air quality inspection industry
- C 语言结构体数组指针以及函数
- Top command
- 个人信息管理系统
- Pytorch deep learning practice-b station Liu erden-day3
- Slag learning path (1) output the calendar page of a certain month of a certain year
- 总价合同、成本补偿合同、工料合同
猜你喜欢

Wireshark packet capture: message information

银河麒麟桌面操作系统V10SP1(X86)安装SQL Developer

STM32 serial communication related learning

Pytorch deep learning practice-b station Liu erden-day4

What is tsd/qsd? What is CS Genesis SD NAND?

Learning about STM assembler design

5-17 hidden student services of Shaanxi University of science and technology

What is data center?
![[CS Genesis] comparative analysis of advantages and disadvantages of SD NAND and raw NAND](/img/d8/a367c26b51d9dbaf53bf4fe2a13917.png)
[CS Genesis] comparative analysis of advantages and disadvantages of SD NAND and raw NAND

Double code time scale network diagram
随机推荐
F5 GTM(一):DNS参数
Sed command of text three swordsman -- text replacement; Grep command - text filtering
小迪网络安全-笔记 加密编码算法(6)
判断凹凸(数学题)
Relevant knowledge points of Gugao motion control card
中国知网论文free下载的方法
How to make good use of cost compensation contract in government procurement
5-17 hidden student services of Shaanxi University of science and technology
Text three swordsman's awk command -- interception
邮资范围(数组 or +函数)
【自动化测试】——robotframework实战(一)搭建环境
ARM开发环境入门
Network layer and IP learning
Slag learning path (1) output the calendar page of a certain month of a certain year
Application case of CS brand sdnand in color detector industry
F5ltm (I) logic diagram
破译密码(综合)
day01(Flume)
Application case of CS brand SD NAND in air quality inspection industry
Alien Slackware