1295. 统计位数为偶数的数字
int findNumbers(int* nums, int numsSize){ if (nums == NULL) return 0; int res = 0; for (int i = 0; i < numsSize; i++) { int tempNum = nums[i]; int digitCount = 0; while (tempNum > 0) { digitCount ++; tempNum /= 10; } if (digitCount % 2 == 0) res ++; } return res; }
Please call me JiangYouDang!