C语言二维数组的遍历

#include <stdio.h>
int main()
{
    int arr[3][3] = {{1,2,3},{4,5,6},{7,8,9}};
    int i,j;
    int sum=0;
    for(i=0;i<3;i++)
    {
        for(j=0;j<3;j++)
        {
            printf("%d ",arr[i][j]);
        }
        printf("\n");
    }
    return 0;    
}
原创文章 55 获赞 17 访问量 3659

猜你喜欢

转载自blog.csdn.net/qq_42942881/article/details/104901442