题解 | #数位五五#
数位五五
https://ac.nowcoder.com/acm/problem/22168
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int a = scan.nextInt();
int b = scan.nextInt();
int count = 0; //记录符合条件的个数
for(int i = a; i <= b; i++){
int num = i;
int sum = 0; //记录个数数为之和
while(num != 0){
sum += num % 10;
num /= 10;
}
if(sum % 5 == 0){
count++;
}
}
System.out.println(count);
}
}