13.01 - char[] c = new char[s.Length];
for(int i = 0; i < s.Length; i++){
int n = (int)s[i];
if (n >= (int)'t'){
n = (int)'a' - ((int)'z' - n + 1);
}
c[i] = Convert.ToChar(n + 7);
}
return new string(c);
13.02 - char[] c = new char[s.Length];
for(int i = 0; i < s.Length; i++){
int n = (int)s[i];
if (n >= (int)'|'){
n = (int)'0' - ((int)'~' - n + 1);
}
c[i] = Convert.ToChar(n + 3);
}
return new string(c);
13.03 - char[] c = new char[s.Length];
for(int i = 0; i < s.Length; i++){
int n = (int)s[i];
if (n > (int)'z' - (4 * i) - 1){
n = (int)'a' - ((int)'z' - n + 1);
}
c[i] = Convert.ToChar(n + (4 * i) + 1);
if ((int)c[i] > (int)'z'){
c[i] = Convert.ToChar(((int)'a' + ((int)c[i] - (int)'z')) - 1);
}
}
return new string(c);
13.04 - char[] c = new char[s.Length];
for(int i = 0; i < s.Length; i++){
if(i % 4 == 0){
int n = (int)s[i];
if (n >= (int)'y'){
n = (int)'a' - ((int)'z' - n + 1);
}
c[i] = Convert.ToChar(n + 2);
}
if(i % 4 == 1){
int n = (int)s[i];
if (n >= (int)'x'){
n = (int)'a' - ((int)'z' - n + 1);
}
c[i] = Convert.ToChar(n + 3);
}
if(i % 4 == 2 || i % 4 == 3){
int n = (int)s[i];
if (n >= (int)'h'){
n = (int)'a' - ((int)'z' - n + 1);
}
c[i] = Convert.ToChar(n + 19);
}
}
return new string(c);
No comments:
Post a Comment