#include <stdio.h>
int main(void) {
int array[9] = {
1, 2, 3,
4, 5, 6,
7, 8, 9
}, x, y, *pointer[3];
for(y=0;y<3;y++) {
for(x=0;x<3;x++) {
printf("%2d ", array
[y
* 3 + x
]); }
}
for(y=0;y<3;y++) {
// pointer[y] = (int**)&(array[y * 3]);
pointer[y] = &(array[y * 3]);
for(x=0;x<3;x++) {
// pointer[y][x] = (int*)((y * 3 + x + 1) * 10);
pointer[y][x] = (y * 3 + x + 1) * 10;
printf("%2d ", array
[y
* 3 + x
]); }
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbih2b2lkKSB7CglpbnQgYXJyYXlbOV0gPSB7CiAJCTEsIDIsIDMsCiAJCTQsIDUsIDYsCiAJCTcsIDgsIDkKCX0sIHgsIHksICpwb2ludGVyWzNdOwoKCXB1dHMoIlt5ICogMyArIHhdIik7Cglmb3IoeT0wO3k8Mzt5KyspIHsKICAJCWZvcih4PTA7eDwzO3grKykgewogICAgCQlwcmludGYoIiUyZCAiLCBhcnJheVt5ICogMyArIHhdKTsKICAJCX0KICAJCXB1dHMoIiIpOwoJfQoKCXB1dHMoIlt5XVt4XSIpOwoJZm9yKHk9MDt5PDM7eSsrKSB7Ci8vCQlwb2ludGVyW3ldID0gKGludCoqKSYoYXJyYXlbeSAqIDNdKTsKCQlwb2ludGVyW3ldID0gJihhcnJheVt5ICogM10pOwogIAkJZm9yKHg9MDt4PDM7eCsrKSB7Ci8vICAJCQlwb2ludGVyW3ldW3hdID0gKGludCopKCh5ICogMyArIHggKyAxKSAqIDEwKTsKICAJCQlwb2ludGVyW3ldW3hdID0gKHkgKiAzICsgeCArIDEpICogMTA7CiAgICAJCXByaW50ZigiJTJkICIsIGFycmF5W3kgKiAzICsgeF0pOwogIAkJfQogIAkJcHV0cygiIik7Cgl9CgoJcmV0dXJuIDA7Cn0K