Advertisement
CMatchelo

Untitled

Dec 13th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. static void contaDigitos(int a, int b)
  2. {
  3. int count = 0;
  4. char[] digitos = String.valueOf(a).toCharArray();
  5. for (char d : digitos) {
  6. if (Character.getNumericValue(d)==b) {
  7. count++;
  8. System.out.println("incr");}
  9.  
  10. }
  11. System.out.println(count);
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement