#include<stdio.h> int main() { int i,count,p,q; scanf("%d%d",&p,&q); count=0; int a,c; for(i=p+1;i<q;i++) { a=i;c=0; while(a!=0){ c=c+a%10;//依次取出个位,十位,百位.... a=a/10; } if(c%5==0)count++; } printf("%d",count); return 0; }
扫描二维码,关注牛客
下载牛客APP,随时随地刷题
全部评论
(1) 回帖