Guest User

Untitled

a guest
Jan 18th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. /**********************************************************************************/
  2. /* Problem: d490 "我也愛偶數" from 板橋高中 */
  3. /* Language: JAVA (477 Bytes) */
  4. /* Result: AC(90ms, 2.4MB) judge by this@ZeroJudge */
  5. /* Author: ssc24 at 2011-09-26 12:32:12 */
  6. /**********************************************************************************/
  7.  
  8.  
  9. package javaapplication42;
  10. import java.util.*;
  11. import java.math.*;
  12.  
  13.  
  14.  
  15. public class JavaApplication42 {
  16.  
  17.  
  18. public static void main(String[] args) {
  19.  
  20. Scanner sc = new Scanner(System.in);
  21.  
  22. while (sc.hasNext()){
  23. int a = sc.nextInt();
  24. int b = sc.nextInt();
  25. int sum=0;
  26. for(int i=a;i<=b;i++){
  27. if(i%2==0){
  28. sum += i;
  29. }
  30. }
  31. System.out.println(sum);
  32. }//whlle*/
  33. }//main
  34.  
  35. }//class
Add Comment
Please, Sign In to add comment