Solution is correct. Why program said it's not correct. PLEASE, HELP! What is the problem with my code?
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 {
//write your code here
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int even = 0;
int odd = 0;
while (n > 0) {
int remainder = n % 10;
if (remainder % 2 == 0)
even++;
else
odd++;
n = n / 10;
}
System.out.println ( "Even: " +
even);
System.out.println ( "Odd: " +
odd);
}
}