#include <stdio.h>
typedef unsigned int U32;
U32 g_zeronum;
U32 zerocount(U32 n);
int main(int argc, char *argv[])
{
U32 m[100],n[100];
U32 i=0,j,k;
U32 zeronumber=0;
printf("Please Input m and n:\n");
while(1)
{
scanf("%d %d",&m[i],&n[i]);
if(m[i]>n[i])
{
printf("Make sure m < = n !!\n");
continue;
}
if((m[i]==-1)&&(m[i]==-1))
break;
i++;
}
for(j=0;j<i;j++)
{
zeronumber=0; /*clear*/
if(m[j]==n[j])
{
zeronumber+=zerocount(m[j]);
printf("there are %d zeros from %d to %d\n",zeronumber,m[j],n[j]);
}
else
{
for(k=m[j];k<=n[j];k++)
zeronumber+=zerocount(k);
printf("there are %d zeros from %d to %d\n",zeronumber,m[j],n[j]);
}
}
return 0;
}
U32 zerocount(U32 n)
{
g_zeronum=0; /*clear*/
do
{
if((n%10)==0)
g_zeronum=g_zeronum+1;
n=n/10;
}
while (n);
return(g_zeronum);
}