int n;scanf("%d", n);int* p;p = (int *) malloc (sizeof(int)*n);用完之后一定要释放内存,不然会内存泄漏free(p);
int n;int *p = NULL;scanf("%d",&n);p = (int *)malloc(sizeof(int) * n);if (p == NULL){return fault;}