// 根据最终b数组的结果更新a数组 voidupdate(){ for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; ++j) { a[i][j] = a[i][j-1] + a[i-1][j] - a[i-1][j-1] + b[i-1][j-1]; } } }
voidinput(){ scanf("%d %d %d", &n, &m, &q); for (int i = 1; i <= n; ++i) a[i][0] = 0; for (int i = 1; i <= m; ++i) a[0][m] = 0; for (int i = 1; i <= n; ++i) { for (int j = 1; j <= m; ++j) { scanf("%d", &a[i][j]); } } }
voidoutput(){ for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; ++j) { printf("%d ", a[i][j]); } printf("\n"); } }