#include<stdio.h>
int main()
{
struct{
unsigned char a:4;
unsigned char b:4;
}i;
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) {
printf("A = %d, B = %d\n", i.a, i.b);
}
}
}
return 0;
}
output:
A = 1, B = 2
A = 1, B = 3
A = 1, B = 5
A = 1, B = 6
A = 1, B = 8
A = 1, B = 9
A = 2, B = 1
A = 2, B = 3
A = 2, B = 4
A = 2, B = 6
A = 2, B = 7
A = 2, B = 9
A = 3, B = 1
A = 3, B = 2
A = 3, B = 4
A = 3, B = 5
A = 3, B = 7
A = 3, B = 8
A = 4, B = 2
A = 4, B = 3
A = 4, B = 5
A = 4, B = 6
A = 4, B = 8
A = 4, B = 9
A = 5, B = 1
A = 5, B = 3
A = 5, B = 4
A = 5, B = 6
A = 5, B = 7
A = 5, B = 9
A = 6, B = 1
A = 6, B = 2
A = 6, B = 4
A = 6, B = 5
A = 6, B = 7
A = 6, B = 8
A = 7, B = 2
A = 7, B = 3
A = 7, B = 5
A = 7, B = 6
A = 7, B = 8
A = 7, B = 9
A = 8, B = 1
A = 8, B = 3
A = 8, B = 4
A = 8, B = 6
A = 8, B = 7
A = 8, B = 9
A = 9, B = 1
A = 9, B = 2
A = 9, B = 4
A = 9, B = 5
A = 9, B = 7
A = 9, B = 8