include stdio include stdlib int main int scanf int malloc sizeof int

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
#include <stdio.h>
#include <stdlib.h>
int main() {
int n, m, i;
scanf("%d%d", &n, &m);
int** a;
a = malloc(sizeof(int*) * n);
for (i = 0; i < n; i++) {
a[i] = malloc(sizeof(int) * m);
}
//ну и потом чистим память
for (i = 0; i < n; i++) {
free(a[i]);
}
free(a);
return 0;
}