//java solution
import java.io.*;
import java.math.*;
import java.util.*;
class Main
{
public static void main (String args[]) // entry point from OS
{
Main myWork = new Main(); // create a dynamic instance
myWork.Begin(); // the true entry point
}
void Begin()
{
try
{
int n;
BigInteger b=new BigInteger("1");
Scanner sc=new Scanner(System.in);
while(sc.hasNextInt())
{
n=sc.nextInt();
for(int i=1;i<=n;i++)
b=b.multiply(BigInteger.valueOf(i));
System.out.println(n+"!");
System.out.println(b.toString());
b=BigInteger.ONE;
}
}
catch(Exception e)
{
System.exit(0);
}
}
}
import java.io.*;
import java.math.*;
import java.util.*;
class Main
{
public static void main (String args[]) // entry point from OS
{
Main myWork = new Main(); // create a dynamic instance
myWork.Begin(); // the true entry point
}
void Begin()
{
try
{
int n;
BigInteger b=new BigInteger("1");
Scanner sc=new Scanner(System.in);
while(sc.hasNextInt())
{
n=sc.nextInt();
for(int i=1;i<=n;i++)
b=b.multiply(BigInteger.valueOf(i));
System.out.println(n+"!");
System.out.println(b.toString());
b=BigInteger.ONE;
}
}
catch(Exception e)
{
System.exit(0);
}
}
}
No comments:
Post a Comment