leetcode-剑指17-OK

language: C

address

// nt题,不解释
/**
 * Note: The returned array must be malloced, assume caller calls free().
 */
int* printNumbers(int n, int* returnSize){
    returnSize[0] = pow(10,n)-1;
    int *ans = (int *)malloc(sizeof(int) *returnSize[0]);
    for(int i = 0; i<returnSize[0];i++)
        ans[i]=i+1;
    return ans;
}
posted @ 2021-01-25 09:03  RougeBW  阅读(31)  评论(0编辑  收藏  举报