求0-7所能组成的8位奇数个数。
public static void test14(){
int i =0;
for(int a=1;a<8;a++){
for(int b=0;b<8;b++){
if(b == a){
continue;
}
for(int c=0;c<8;c++){
if(c == a || c == b){
continue;
}
for(int d=0;d<8;d++){
if(d == a || d == b || d == c){
continue;
}
for(int e=0;e<8;e++){
if(e == a || e == b || e == c || e == d){
continue;
}
for(int f=0;f<8;f++){
if(f == a || f == b || f == c || f == d || f == e){
continue;
}
for(int g=0;g<8;g++){
if(g == a || g == b || g == c || g == d || g == e || g == f){
continue;
}
for(int h=0;h<8;h++){
if(h != a && h != b && h != c && h != d && h != e && h != f && h != g && h%2 != 0){
i++;
}
}
}
}
}
}
}
}
}
System.out.println(i);
}