package zh.codegym.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 { //在此编写你的代码 BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); int num = Integer.parseInt(reader.readLine()); while (num > 0) { if (num % 2 == 0) { even++; num /= 10; } else { odd++; num /= 10; } } System.out.println("偶数: " + even + " 奇数: " + odd); } }