题解 | #数位五五#
数位五五
https://www.nowcoder.com/practice/4306996b0a534178b90b3514a8b30028
#include <stdio.h> int test(int a, int b); int main() { int a, b; scanf("%d %d", &a, &b); int z = test(a, b); printf("%d", z); return 0; } int test(int a, int b) { int count = 0; for (int i = a; i <= b; i++) { int temp = i; int sum = 0; while (temp > 0) { sum += temp % 10; temp /= 10; } if (sum % 5 == 0) { count++; } } return count; }