Code Below:


import java.util.*;
class spy
{
    public static void main()
    {
        Scanner s=new Scanner(System.in);
        int n,a,sum=0,k=1;
        System.out.println("enter a no.");
        n=s.nextInt();
        while(n>0)
        {
            a=n%10;
            sum=sum+a;
            k=k*a;
            n=n/10;
        }
        if (sum==k)
        System.out.println("SPY NO.");
        else
        System.out.println("NOT SPY NO.");
    }
}