package com.codegym.task.task06.task0606; import java.io.*; import java.util.Scanner; /* Even and odd digits */ public class Solution { public static int even; public static int odd; public static void main(String[] args) throws IOException { int temp, digit, even=0, odd=0, evenCount=0, oddCount=0; Scanner scanner = new Scanner(System.in); temp= scanner.nextInt(); scanner.close(); while (temp>0) { digit=temp%10; if (digit%2==0) { evenCount++; } else { oddCount++; } temp=temp/10; } even=evenCount; odd=oddCount; System.out.print("Even: "+even); System.out.print(" Odd: "+odd); } }