Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import static java.lang.Math.pow;
- import static java.lang.Math.sqrt;
- import java.util.Scanner;
- public class Main {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- // TODO code application logic here
- Scanner input=new Scanner(System.in);
- while(input.hasNext()){
- int x,y,i,count=0;
- x=input.nextInt();
- y=input.nextInt();
- if(x==0&&y==0){
- break;
- }
- else{
- for(i=x;i<=y;i++){
- int temp=(int) Math.sqrt(i);
- if(i==Math.pow(temp,2)){
- count++;
- }
- }
- System.out.println(count);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement