有这样一段java代码
public static void main(String[] args) {
int state = 8688201;
int index = 101;
for (int i = 1; i < 11; i++) {
int a1 = state & ((int) Math.pow(8, ((index * 10 + i - 1) % 10)) * 7);
int a2 = (int) Math.pow(8, ((index * 10 + i - 1) % 10));
int stateDecode = a1 / a2;
System.out.println("index:" + (index * 10 + i) + ",stateDecode:" + stateDecode);
}
}
可以得到1011到1020的stateDecode,运行结果:
index:1011,stateDecode:1
index:1012,stateDecode:1
index:1013,stateDecode:1
index:1014,stateDecode:1
index:1015,stateDecode:1
index:1016,stateDecode:1
index:1017,stateDecode:1
index:1018,stateDecode:4
index:1019,stateDecode:0
index:1020,stateDecode:0
反之,要是已知1011到1020的stateDecode,如何得到state?