d485: 我愛偶數
題目:http://zerojudge.tw/ShowProblem?problemid=d485
程式碼:
程式碼:
import java.util.Scanner;
public class d485 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc= new Scanner(System.in);
while(sc.hasNext()){
int s = sc.nextInt();//輸入數字
int e = sc.nextInt();
s += (s%2);
e -= (e%2);
System.out.println((e-s)/2+1);
}
}
}

留言
張貼留言