#include <stdio.h> int statistic(int x, int y)//统计个数函数 { int i = 0;//遍历 int k = 0;//计数用 for (i = x; i <= y; i++) { int sum = 0;//统计位数和 int d = i; while (d != 0)//循环条件 { int e = d % 10; d = d / 10; sum = sum + e; } if (sum % 5 == 0)//计数条件 { k++; } } return k; } int main() { int a, b;//范围 scanf("%d %d", &a, &b); int c = statistic(a, b); printf("%d\n", c);//打印输出 return 0; }