Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void contaDigitos(int a, int b)
- {
- int count = 0;
- char[] digitos = String.valueOf(a).toCharArray();
- for (char d : digitos) {
- if (Character.getNumericValue(d)==b) {
- count++;
- System.out.println("incr");}
- }
- System.out.println(count);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement