>>801
int (*a)[3];
a = (int (*)[3])malloc(sizeof(int [3]) * n);
だな