POJ2811 未完成

import java.util.Scanner;

public class POJ2811 {
public static void main(String[] args) {
char[] oriLights = new char[5];
char[] lights = new char[5];
char[] result = new char[5];
Scanner scanner = new Scanner(System.in);
int time = scanner.nextInt();
while (time– != 0) {
for (int i = 0; i < 5; i++) {
for (int j = 0; j < 6; j++) {
int value = scanner.nextInt();
System.out.println(value);
setBit(oriLights[i], j, value);
}
}
for (int i = 0; i < 64; i++) {

        }
    }
}
private static int getBit(char c,int i){
    return (c >> i) & 1;//1010 0101 0001->0001
}
private static void setBit(char c,int i,int value){
    if (value == 1) {
        c |= (1 << i);  //1010 0001->1011
    }else{
        c &= ~(1 << i);    //1010 1110->1010
    }
}
private void flipBit(char c,int i){
    c ^= (1 << i);//1010 0001->1011
}
private static void printResult(int t,char result[]){
    System.out.println("PUZZLE #" + t);
    for (int i = 0; i < 5; i++) {
        for (int j = 0; j < 6; j++) {
            System.out.println(getBit(result[i], j));
            if (j != 5) {
                System.out.println(" ");
            }
        }
    }
}

}

你可能感兴趣的:(数据结构,算法)