[Zhengqing] [1781] The Monk's Troubles 7 - Chanting Sutras

Problem Description

Loading...

Problem Analysis

Another string processing problem
Lowercase letters only
So it’s even simpler than the previous ones -.-

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

Speaking of… chanting sutras…
Well… I really want to complain about this…

Problem link: [ZZULI][1781] Monk’s Troubles 7 — Chanting Sutras

Loading...