Advertisement
noshin98

uva -10783

Jun 25th, 2016
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int t,a,b,i,j,sum;
  5. while(scanf("%d",&t)==1)
  6. {
  7. for(i=1;i<=t;i++)
  8. {
  9.  
  10. scanf("%d%d",&a,&b);
  11. if( a%2==1 && b%2==1)
  12.  
  13. {
  14. j=a+2;
  15. for(j=a+2;j<=b;j=j+2)
  16. {
  17.  
  18.  
  19. sum=a+j;
  20. a=sum;
  21. }
  22. }
  23. printf("Case %d: %d\n",i,sum);
  24.  
  25.  
  26. }
  27. }
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement