Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- long long int t,a,b,n,i,j;
- scanf("%lld",&t);
- for(i=1;i<=t;i++)
- {
- n=0;
- scanf("%lld%lld",&a,&b);
- for(j=a;j<=b;j++)
- {
- if(j%2==0)
- continue;
- if(j%2==1)
- {
- n=n+j;
- }
- }
- printf("Case %lld: %lld\n",i,n);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment