Given a positive integer num, return the number of positive integers less than or equal to num whose digit sums are even.

The digit sum of a positive integer is the sum of all its digits.

&nbsp;
Example 1:

Input: num = 4
Output: 2
Explanation:
The only integers less than or equal to 4 whose digit sums are even are 2 and 4.    


Example 2:

Input: num = 30
Output: 14
Explanation:
The 14 integers less than or equal to 30 whose digit sums are even are
2, 4, 6, 8, 11, 13, 15, 17, 19, 20, 22, 24, 26, and 28.


&nbsp;
Constraints:


	1 &lt;= num &lt;= 1000


class Solution:
    def countEven(self, num: int) -> int:
        if num%2!=0:
            return (num//2)
        s=0
        t=num
        while t:
            s=s+(t%10)
            t=t//10
        if s%2==0:
            return num//2
        else:
            return (num//2)-1
class Solution
{
    public int countEven(int num)
    {
        int count = 0;
        for(int i = 1; i <= num; i++)
            if(sumDig(i))
                count++;
        return count;
    }
    private boolean sumDig(int n)
    {
        int sum = 0;
        while(n > 0)
        {
            sum += n % 10;
            n /= 10;
        }
		return (sum&1) == 0 ? true : false;
    }
}
class Solution {
public:
    int countEven(int num) {
        int temp = num, sum = 0;
        while (num > 0) {
            sum += num % 10;
            num /= 10;
        }
        return sum % 2 == 0 ? temp / 2 : (temp - 1) / 2;
    }
};
var countEven = function(num) {
    let count=0;
    for(let i=2;i<=num;i++){
        if(isEven(i)%2==0){
            count++;
        }
    }
    return count
};

const isEven = (c) =>{
    let sum=0;
    while(c>0){
        sum+=(c%10)
        c=Math.floor(c/10)
    }
    return sum
}
Count Integers With Even Digit Sum