#include <stdio.h>
#include <math.h>

int main(void){
    int y=0;
    int n, m =0;
    scanf("%d %d", &n, &m );
    int a[n+1][m+1];
    for(int f=0; f<n; f++)
    {
        for(int g=0; g<m; g++)
        {
            scanf("%d", &a[g][f]);
        }
    }
    int b = a[0][0];
    int c = a[0][1];

    for(int f=0; f<n; f++)
    {
        for(int g=0; g<m; g++)
        {
            y=y+a[g][f];
            printf("%d ", y);
        }
        printf("\n");
        y=a[0][f];
    }

    a[0][0], a[0]+ a[1], a[0]+ a[1]+ a[2],  a[0]+ a[1]+ a[2] + a[3],  a[0]+ a[1]+ a[2] + a[3] + a[4]
    a[1][0], a[0][1]+ a[1]+ a[1][0], a[0]+ a[1]+ a[2]
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: