📜  print 2d array in - C 编程语言代码示例

📅  最后修改于: 2022-03-11 15:04:39.428000             🧑  作者: Mango

代码示例3
#include 

#define MAX 10

int main()
{
    char grid[MAX][MAX];
    int i,j,row,col;

    printf("Please enter your grid size: ");
    scanf("%d %d", &row, &col);


    for (i = 0; i < row; i++) {
        for (j = 0; j < col; j++) {
            grid[i][j] = '.';
            printf("%c ", grid[i][j]);
        }
        printf("\n");
    }

    return 0;
}