package com.javarush.task.task06.task0606;

import java.io.*;

/*
Чётные и нечётные циферки
*/

public class Solution {

    public static int even;
    public static int odd;

    public static void main(String[] args) throws IOException {
        even = 0;
        odd = 0;
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        /*String a = reader.readLine();
        for(int i = 0; i < a.length(); i++){

        }*/
        int a = Integer.parseInt(reader.readLine());
        int temp;
        for(int i = 10; (float)a / i >= 0.1f; i *= 10){
            temp = a / i;
            float x = (float) a / i;
            float b = Math.abs(x - temp);
            if(b == 0)
                System.out.println(b);
            else if((int)(b * 10) % 2 == 0)
                even++;
            else
                odd++;
        }

        /*int a = Integer.parseInt(reader.readLine());
        int b;
        for(int i = 10; (float)a / i >= 0.1f; i *= 10) {
            b = a % i;
            if (b == 0)
                System.out.println(b);
            else if (b % 2 == 0)
                even++;
            else
                odd++;
        }*/
            System.out.println("Even: " + even + " Odd: " + odd);

    }
}
При первом делении (т.е. крайней цифры), например: 13, 23 и некоторые другие числа при делении из 3 получается 2999999... P.S. Не обращайте внимания на комменты)