1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
import java.util.Scanner; /** * UVA11461 */ public class UVA11461 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()) { double n1 = sc.nextDouble(), n2 = sc.nextDouble(); if (n1 == 0 && n2 == 0) break; int count = 0; for (double i = n1; i <= n2; i++) { String Sqrt = String.valueOf(Math.sqrt(i)); String temp = Sqrt.substring(Sqrt.indexOf(".") + 1, Sqrt.length()); if (temp.length() == 1) count++; } System.out.println(count); } sc.close(); } } |