题解 | #数位五五#
数位五五
https://www.nowcoder.com/practice/4306996b0a534178b90b3514a8b30028
#include <iostream> using namespace std; int bei(int a,int b) { int count=0; for(int i=a; i>=a&&i<=b;i++) { int j=i; int sum=0; for(j;j>0;j=j/10) { sum=sum+j%10; } if(sum%5==0) count++; } return count; } int main() { int a,b; cin>>a>>b; cout<<bei(a,b); return 0; }