Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int tc,i,x,y,sum=0;
- scanf("%d",&tc);
- for(i=0;i<tc;i++){
- scanf("%d%d",&x,&y);
- if(x<y){
- for(x=x+1;x<y;x++){
- if(x%2!=0){
- sum=sum+x;
- }
- }
- }
- else if(x>y){
- for(y=y+1;y<x;y++){
- if(y%2!=0){
- sum=sum+y;
- }
- }
- }
- printf("%d\n",sum);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement