Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. package acm;
  2. import java.io.*;
  3. import java.util.*;
  4.  
  5. public class Light {
  6.     public static void main(String[] args) throws IOException {
  7.         ArrayList<String> userInput = new ArrayList<String>();
  8.         BufferedReader bs = new BufferedReader(new InputStreamReader(
  9.                 System.in));
  10.         String input = bs.readLine();
  11.         while (!input.equalsIgnoreCase("0")) {
  12.                 userInput.add(input);
  13.                 input = bs.readLine();
  14.         }
  15.         Iterator it = userInput.iterator();
  16.         while (it.hasNext()) {
  17.             String numbers = (String) (it.next());
  18.             squareRoot(numbers);
  19.         }
  20.     }
  21.  
  22.     public static void squareRoot(String s) {
  23.         double db=Math.sqrt(Double.parseDouble(s));
  24.         if(db!=Math.ceil(db)){
  25.             System.out.println("no");
  26.         }else{
  27.             System.out.println("yes");
  28.         }
  29.     }
  30. }