Md. Arifur Rahman (Sazal)
ক্রমে ক্রমে হ্রাস পাচ্ছে বিবেক, ঘুমিয়ে পড়ছে মানবতা……
Pages
Home
ACM Algorithm
Math
E- Balagurusamy
Basic Program
Assembly Language
Gallery
My Portfolio
Wednesday, 18 May 2011
10783-Odd sum
#include<stdio.h>
int main()
{
register int t,a,b,i,j;
//freopen("in.txt","r",stdin);
scanf("%d",&t);
for(i=1;i<=t;i++)
{
int sum=0;
scanf("%d%d",&a,&b);
if(!(a&1))
a|=1;
for(j=a;j<=b;j+=2)
sum+=j;
printf("Case %d: %d\n",i,sum);
}
return(0);
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment