import java.io.*;
public class automorphic
{
public static void main(String args[])throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter a number");
int num = Integer.parseInt(br.readLine());
int digits = 0;
int temp = num;
while(temp>0)
{
digits++;
temp = temp/10;
}
int square = num*num;
int last = square % (int) Math.pow(10, digits);
if(num == last)      
{
System.out.println("Automorphic");
}
else
{
System.out.println("Not Automorphic");
}
}
}

Post a Comment

 
Top