答案 0 :(得分:1)
当且仅当r
是偶数时,第c
行第r + c
列的正方形为“白色”。
答案 1 :(得分:0)
我可以为您编写伪代码
int boxes[10][10];
for (int i =0; i < 10; i++)
{
for (int j=0; j<10; j++)
{
if (i+j % 2 ==0)
Color color = "red";
else
Color color = "green";
int width = Getwidth(i); // get the width of you want, since all boxes have same width at the same column.
int hight = Getheight(j); //Same as before
drawBox(i,j,width,hight, color);
}
}