int main() {
char gameArea[][8] = {
{'X','X','X','X','X','X','X','X'},
{'X','X','X','X','X','X','X','X'},
{'X','X','X','X','X','X','X','X'},
{'X','X','X','X','X','X','X','X'},
{'X','X','X','X','X','X','X','X'},
{'X','X','X','X','X','X','X','X'},
{'X','X','X','X','X','X','X','X'},
{'X','X','X','X','X','X','X','X'}};
int i = 0; int j = 0;
while (i<8) {
while (j<8) {
printf("%c",gameArea[i][j]);
j++;
}
i++;
}
return 0;
}
XXXXXXXX
Process returned 0 (0x0) execution time : 0.563 s
Press any key to continue.
從理論上講,i
將通過列運行,並且打印所有的,但是這並沒有發生。我非常感謝你的幫助。
使用for循環+1! :-) – Mithrandir