【leetcode】自除数
bool func(int x){
int temp = x;
while(temp){
if(temp % 10 && x % (temp % 10) == 0) temp /= 10;
else return false;
}
return true;
}
int* selfDividingNumbers(int left, int right, int* returnSize){
int* arr = (int*)calloc(right-left,sizeof(int));
int n=0;
for (int i=left; i<=right; i++)if (func(i)) arr[n++] = i;
*returnSize = n;
return arr;
}