![](https://static.youtibao.com/asksite/comm/h5/images/m_q_title.png)
[单选题]
已知程序功能为:为图形中不同行的矩形填充颜色,要求一行中矩形颜色相同。请在程序空档出选择填写正确语句: int [ ][ ]myRect = { {10,10}, {10,20}, {10,30},{10,40}, {20,10}, {20,20}, {20,30},{20,40}, {30,10}, {30,20}, {30,30},{30,40}, {40,10}, {40,20}, {40,30},{40,40} }; int [ ][ ]myColor = { {187, 255,255},{0,205, 205},{0,139, 139},{82,139, 139} }; void setup() { size(400,600); background(220); } void draw() { int i=0; int col; background(220);//刷新屏幕显示 for(i=0;i<=15;i++) { col=i%4; //填色 rect(myRect[i][0],myRect[i][1],10,10); } } }
A.fill(myColor[col][0],myColor[col][1],myColor[col][2]);
B.fill(myColor[0][col],myColor[1][col],myColor[2][col]);
C.fill(myColor[col][0],myColor[1][col],myColor[col][2]);
D.fill(myColor[0][col],myColor[col][1],myColor[2][col]);
查看答案
![](https://static.youtibao.com/asksite/comm/h5/images/solist_ts.png)