Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class test {
- static int s = 0;
- public static void f(int n) {
- if (n > 0) {
- if ((n % 10) % 2 == 0) {
- s++;
- }
- f(n / 2);
- }
- }
- public static void main(String[] args) {
- Scanner in = new Scanner(System.in);
- int n = in.nextInt();
- f(n);
- System.out.print(s);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement