Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
475 B
391
Indexable
Never

public class Main {

		Scanner sc = new Scanner(System.in); 
		
		int a = sc.nextInt(); 
		int b = sc.nextInt();  

		int sumCount = 0; 
		
		for(int i = a; i <= b; i++) { 
			sumCount += Check5(i);
		} 
		System.out.println(sumCount);   

	} 
	public static int  Check5(int n) {  
		int count = 0;
		while(n > 0) {  
		 
			int donvi = n % 10;   
			n = n / 10;  

			if(donvi == 5) { 
				count++;
            }	
		} 
		return count ;
	}
}