#include <stdio.h> void get_num(int num, int* psum) { if (num != 0) { get_num(num / 10, &(*psum)); *psum += num % 10; } } int main() { int l = 0; int r = 0; while (scanf("%d %d", &l, &r) != EOF) { int cnt = 0; for (int i = l; i <= r; i++)//先要产生数 { int sum = 0; get_num(i, &sum); if (sum % 5 == 0) { cnt++; } } printf("%d\n", cnt); } return 0; }