Created
December 22, 2015 02:06
-
-
Save peter279k/9005d0062d8530bd6769 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class main{ | |
public static void main(String[] args) { | |
Scanner input = new Scanner(System.in); | |
int count = 0; | |
String result = ""; | |
while(true) { | |
int a = input.nextInt(); | |
int b = input.nextInt(); | |
if(a == 0 && b == 0) | |
break; | |
for(int i=a;i<=b;i++) { | |
int number = (int)Math.sqrt(i); | |
boolean check = (number * number == i); | |
if(check) | |
count++; | |
} | |
result += count + "\r\n"; | |
count = 0; | |
} | |
System.out.print(result); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment