#include<stdio.h>
int main()
{
int a,b,N,sum = 0,i,j;
while(scanf("%d", &N) != EOF)
{
for(i=1;i<=N;i++)
{
sum = 0;
scanf("%d %d", &a, &b);
for(j=a;j<=b;j++)
{
if(j%2 != 0)
{
sum = sum + j;
}
}
printf("Case %d: %d\n", i, sum);
}
}
return 0;
}
int main()
{
int a,b,N,sum = 0,i,j;
while(scanf("%d", &N) != EOF)
{
for(i=1;i<=N;i++)
{
sum = 0;
scanf("%d %d", &a, &b);
for(j=a;j<=b;j++)
{
if(j%2 != 0)
{
sum = sum + j;
}
}
printf("Case %d: %d\n", i, sum);
}
}
return 0;
}
Comments
Post a Comment