import java.io.*;
import java.lang.*;
class special{
static int r,n,s=0,fact=1,i;
public static void main(String args[])throws Exception{
n=Integer.parseInt(args[0]);
while(n>0)
{
r=n%10;
fact=1;
for(i=1;i<=r;i++)
fact=fact*i;
s=s+fact;
n=n/10;
}
if(Integer.parseInt(args[0])==s)
System.out.println("Special");
else
System.out.println("NOT");
}
}
import java.lang.*;
class special{
static int r,n,s=0,fact=1,i;
public static void main(String args[])throws Exception{
n=Integer.parseInt(args[0]);
while(n>0)
{
r=n%10;
fact=1;
for(i=1;i<=r;i++)
fact=fact*i;
s=s+fact;
n=n/10;
}
if(Integer.parseInt(args[0])==s)
System.out.println("Special");
else
System.out.println("NOT");
}
}
Comments