#include <stdio.h>
void calculate(int (*a)[4]);
int main(void) {
int a[3][4] = { {1,2,3,4}, {5,6,7,8}, {9,10,11,12} };
calculate(a);
return 0;
}
void calculate(int (*a)[4]) {
int sum;
for(int i=0;i<3;i++){
sum = 0;
for(int j=0;j<4;j++){
sum = sum + a[i][j];
}
}
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkIGNhbGN1bGF0ZShpbnQgKCphKVs0XSk7CgppbnQgbWFpbih2b2lkKSB7CglpbnQgYVszXVs0XSA9IHsgezEsMiwzLDR9LCB7NSw2LDcsOH0sIHs5LDEwLDExLDEyfSB9OwoJCgljYWxjdWxhdGUoYSk7CgkKCXJldHVybiAwOwp9Cgp2b2lkIGNhbGN1bGF0ZShpbnQgKCphKVs0XSkgewoJaW50IHN1bTsKCWZvcihpbnQgaT0wO2k8MztpKyspewoJCXN1bSA9IDA7CgkJZm9yKGludCBqPTA7ajw0O2orKyl7CgkJCXN1bSA9IHN1bSArIGFbaV1bal07CgkJfQoJCXByaW50ZigiJWRcbiIsIHN1bSk7Cgl9Cn0K