求助。。。测评题
以下程序是一个信息编码的程序,阅读其encode部分,并补全其decode部分
最后运行程序,会打印出的一句话。这句话就是我们要求的答案。
注意!这句话是用GBK编码的!
答案请复制粘贴, 不要手动输入
每次重新登录时请重新答题
public class Test {
public static void encode(byte[] in, byte[] out, int password)
{
int len = in.length;
int seed = password ^ 0xb3525314;
for (int i = 0 ; i < len; ++i) {
byte a = (byte)( ( in[i] ^ seed ) >>> 1 );
byte b = (byte)( ( ( ((int)in[i]) << 19 ) ^ seed ) >>> (19-7) );
a &= 0x7f;
b &= 0x80;
out[i] = (byte)(a | b);
seed = (seed * 1792013 ^ seed ^ in[i]);
}
}
public static void decode(byte[] in, byte[] out, int password)
{
int len = in.length;
int seed = password ^ 0xb3525314;
for (int i = 0 ; i < len; ++i) {
// fill the code here
}
}
public static void main(String [] args) throws Exception
{
int password = 0x7edcf276;
byte[] buf1 = {84, 65, 6, 69, 59, 87, -73, -90, 75, -72, -71, -112, 41, -28, -99, 33, -78, 77, -72, -1, -72, -20, -19, 102, 48, -80, -37, -69, 64, -86, -63, -5, 66, 23, 15, -24, -9, -55, 83, 35, 47, -109, 47, 19, };
byte[] buf2 = new byte[buf1.length];
decode(buf1, buf2, password);
System.out.println(new String(buf2, "GBK"));
}
}