Author : Jisan
Programming language : Java
Difficulty : Easy
Status : Accepted
Problem number : UVA-623
http://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=564
Code:
import java.math.BigInteger;
import java.util.*;
public class Uva_623 {
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
BigInteger a,b,c;
while(in.hasNext()){
a=in.nextBigInteger();
c=BigInteger.ONE;
for(b=BigInteger.ONE;b.compareTo(a)<=0;b=b.add(BigInteger.ONE)){
c=c.multiply(b);
}
System.out.println(a +"!"+ "\n"+ c);
}
}
}
Programming language : Java
Difficulty : Easy
Status : Accepted
Problem number : UVA-623
http://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=564
Code:
import java.math.BigInteger;
import java.util.*;
public class Uva_623 {
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
BigInteger a,b,c;
while(in.hasNext()){
a=in.nextBigInteger();
c=BigInteger.ONE;
for(b=BigInteger.ONE;b.compareTo(a)<=0;b=b.add(BigInteger.ONE)){
c=c.multiply(b);
}
System.out.println(a +"!"+ "\n"+ c);
}
}
}
No comments:
Post a Comment