I've run and tested this code over and over and it seems to me to match the task conditions, however its not passing the tests? Does anyone know why?
package com.codegym.task.task06.task0606;
import java.io.*;
/*
Even and odd digits
*/
public class Solution {
public static int even;
public static int odd;
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(reader.readLine());
if (n < 0) n *= -1;
for (int i = 1; i < n; i *= 10) {
int m = n / i;
if (m % 2 == 0)
even++;
else
odd++;
}
System.out.printf("Even: %d Odd: %d", even, odd);
}
}