UVA 11461 Java
import java.util.*; public class main{ public static void main(String[] args) { Scanner sc=new Scanner(System.in); while(sc.hasNextInt()) { int num1 = sc.nextInt(); int num2 = sc.nextInt(); if(num1 == num2 && num1 == 0) break; int count = (int)Math.sqrt(num2) - (int)Math.ceil(Math.sqrt(num1)) + 1; System.out.println(count); } } };
留言
張貼留言