stoychevamaria89

Untitled

May 1st, 2018
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. import java.util.Arrays;
  2. import java.util.Scanner;
  3.  
  4. public class DobriChisla {
  5. public static void main(String[] args){
  6. Scanner in = new Scanner(System.in);
  7. int A = in.nextInt();
  8. int B = in.nextInt();
  9. int currentNum = 0;
  10. int currentDigit = 0;
  11. int count = 1;
  12.  
  13.  
  14. for (int i = A; i <= B; i++){
  15. currentNum = i ;
  16. System.out.println("currentNum = " + currentNum);
  17. char[] digits = String.valueOf(i).toCharArray();
  18. System.out.println("digits array = " + Arrays.toString(digits));
  19.  
  20. for(int j = 0; j < digits.length; j++){
  21. currentDigit = Character.getNumericValue(digits[i]);
  22. System.out.println("currentDigit = " + currentDigit);
  23. if(currentNum / currentDigit == 0){
  24. count ++;
  25. System.out.println(count);
  26. }
  27. }
  28.  
  29. }
  30. }
  31. }
Add Comment
Please, Sign In to add comment