[Zhengqing] [1762] Dml's secret

Problem Description

Loading...

Problem Analysis

Pretty much the same as that string-processing one on HDU
Nothing much to say
What needs attention is
the input here is the encrypted string
and the output is the pre-encryption string

cpp
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#include<stdio.h>
#include<string.h>
int main() {
	char a[120];
	int i;
	scanf("%s",a);
	for(i=0; i<strlen(a); i++) {
		if(a[i]=='a')
			a[i]='z';
		else if(a[i]=='A')
			a[i]='Z';
		else if(a[i]=='0')
			a[i]='9';
		else
			a[i]=a[i]-1;
	}
	printf("%s\n",a);
	return 0;
}

Problem link: [ZZULI][1762] Dml’s secret

This post is licensed under CC BY-NC-SA 4.0. If it helped, or if you have anything to say, the comment box below is open.
Page views —
Unique visitors —

Loading...