The code works but requirements are not satisfied about writing to even and odd.Can some one help?
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 {
//write your code here
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int num = Integer.parseInt(reader.readLine());
int a = num/10000;
int b = num % 10000;
int c = b / 1000;
int d = b % 1000;
int e = d /100 ;
int f = d % 100;
int g = f / 10 ;
int h = f % 10 ;
int even = 0;
int odd = 0;
int count1 = 0;
int count2 = 0;
int number[] = new int[5];
number[0]= a;
number[1] = c;
number[2] = e;
number[3] = g;
number[4] = h;
for(int i = 0;i < 5 ;i++)
{
if(number[i] % 2 == 0)
{
count1++;
}
else
{
count2++;
}
}
even = count1;
odd = count2;
System.out.println("Even: " + even + " Odd: "+ odd );
}
}