Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**********************************************************************************/
- /* Problem: d490 "我也愛偶數" from 板橋高中 */
- /* Language: JAVA (477 Bytes) */
- /* Result: AC(90ms, 2.4MB) judge by this@ZeroJudge */
- /* Author: ssc24 at 2011-09-26 12:32:12 */
- /**********************************************************************************/
- package javaapplication42;
- import java.util.*;
- import java.math.*;
- public class JavaApplication42 {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- while (sc.hasNext()){
- int a = sc.nextInt();
- int b = sc.nextInt();
- int sum=0;
- for(int i=a;i<=b;i++){
- if(i%2==0){
- sum += i;
- }
- }
- System.out.println(sum);
- }//whlle*/
- }//main
- }//class
Add Comment
Please, Sign In to add comment