-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathautomorphic.java
More file actions
37 lines (29 loc) · 870 Bytes
/
automorphic.java
File metadata and controls
37 lines (29 loc) · 870 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/******************************************************************************
Online Java Compiler.
Code, Compile, Run and Debug java program online.
Write your code in this editor and press "Run" button to execute it.
*******************************************************************************/
import java.util.*;
public class Main
{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int num=sc.nextInt();
int sq=num*num;
int flag=0;
while(num>0){
if(num%10!=sq%10){
flag=1;
break;
}else{
sq=sq/10;
num=num/10;
}
}
if(flag==0){
System.out.println("Automorphic");
}else{
System.out.print("Not Automorphic");
}
}
}