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