import java.util.*;
import java.lang.*;
import java.io.*;
//a function that takes an integer argument A. Return 1 if A is a perfect square else 0
//A perfect square is an integer that is the square of an integer. For example 16 is perfect square as it is the square of an integer 4 (42 = 16)
// The main method must be in a class named "Main".
public class Main {
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
int A = scn.nextInt();
int result = solve(A);
System.out.println(result);
}
public static int solve(int A){
int sqrtA = (int)Math.sqrt(A);
if (A <=0) return 0;
for (int i =1; i <= sqrtA ; i++){
if (A == i*i ) return 1 ;
}
return 0 ;
}
}
To embed this project on your website, copy the following code and paste it into your website's HTML: