two step
int *a; int i,n; scanf("%d",&n); a=(int *)malloc(n*sizeof(int)); 这样就相当于C++的定义: int n; int a[n]; cin>>n;
int **arr; int N,M; cin >> N >> M;
arr = new int*[N]; for(int i=0;i<N;i++) { arr[i] = new int[M]; }