Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class uva10783 {
- public static void main(String [] args) {
- Scanner scn = new Scanner(System.in);
- int n = scn.nextInt();
- for(int x=0;x<n;x++) {
- int a = scn.nextInt();
- int b = scn.nextInt();
- int total = 0;
- for(int y=a;y<=b;y++) {
- if((y%2)!=0)
- total += y;
- }
- System.out.println("Case "+(x+1) +": " +total);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement