Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int low,high,x,y=1,z=1,i,k[1000],j=0,case_no=1,t,count=0;
- scanf("%d", &t);
- while(t--)
- {
- scanf("%d %d", &low, &high);
- count=0;
- while(low<=high)
- {
- i=low-1;
- j=0;
- y=1;
- z=1;
- while(i--)
- {
- x=z;
- y=y*10+1;
- z=x+y;
- }
- if(z%3==0)
- {
- count++;
- }
- low++;
- }
- printf("Case %d: %d\n", case_no, count);
- case_no++;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement