>>29
C99以後ならVLAという手もある
int n;
scanf("%d", &n);
double mat[n][n + 1];