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