-
Notifications
You must be signed in to change notification settings - Fork 1
/
count.c
35 lines (33 loc) · 925 Bytes
/
count.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include<stdio.h>
int main()
{
int t;
long r,l,i,temp,count=0;
scanf("%ld",&t);
while(t--)
{
count=0;
scanf("%ld%ld",&l,&r);
for(i=l;i<=r;i++)
{
temp=i;
if(temp%2==0)
count++;
else
{
while(temp>0)
{
if(temp%2==0)
{
count++;
break;
}
else
temp=temp/10;
}
}
}
printf("%ld\n",count);
}
return 0;
}