-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSpynumber.java
More file actions
34 lines (26 loc) · 804 Bytes
/
Spynumber.java
File metadata and controls
34 lines (26 loc) · 804 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
/******************************************************************************
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 n=sc.nextInt();
int sum=0;
int pro=1;
while(n>0){
int rem=n%10;
n=n/10;
sum+=rem;
pro*=rem;
}
if(sum==pro){
System.out.println("Yes, its a spy number");
}else{
System.out.print("Not a spy Number");
}
}
}