{S0}简介
铁路护栏网的密码是你有一些joejoe这样的文字和你分割两行:j e o
o j e
现在你结合的两条线,并得到:jeooje编码
在学校里,我已经学会了如何编码成的铁栅栏密码的东西。具体方法如下:{C}解码
这是如何解码的东西:/// <summary>
/// Decodes stuff into plain text
/// </summary>
/// <param name="input">The string to decode</param>
/// <returns>The decoded result</returns>
public static string DeCode(string input)
{
int lnl = (int)Math.Round((decimal)input.Length / 2);
//Write Strings
char[] ln1, ln2;
ln1 = input.Substring(0, lnl).ToCharArray();
ln2 = input.Substring(lnl).ToCharArray();
#if DEBUG
Debug.WriteLine("Line 1: " + input.Substring(0, lnl));
Debug.WriteLine("Line 2: " + input.Substring(lnl, input.Length - lnl));
#endif
//Writen strings, now seperate into one
bool top = true;
string output = "";
int x, topx, botx;
x = 1; topx = 0; botx = 0;
while( x != input.Length + 1)
{
if(top == true)
{
if(topx > ln1.Length - 1)
{
return output;
}
output += ln1[topx]; topx += 1; top = false;
#if DEBUG
Debug.WriteLine("topx: " + topx + " ln1 length: " + ln1.Length);
#endif
}
else
{
output += ln2[botx]; botx += 1; top = true;
}
x++;
}
return output;
}