只用一个字节 计算象棋将帅之间可能的位置
#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5+10;
struct {
unsigned char a:4;
unsigned char b:4;
}i;
int main() {
for(i.a=1;i.a<=9;i.a++) {
for (i.b=1;i.b<=9;i.b++) {
if(i.a%3==i.b%3) continue;
printf("%d %d\n",i.a,i.b);
}
}
}
using namespace std;
const int MAX = 1e5+10;
struct {
unsigned char a:4;
unsigned char b:4;
}i;
int main() {
for(i.a=1;i.a<=9;i.a++) {
for (i.b=1;i.b<=9;i.b++) {
if(i.a%3==i.b%3) continue;
printf("%d %d\n",i.a,i.b);
}
}
}