输入一个数,计算出它的阶乘
import java.util.Scanner;
public class Hello {
public static void main(String [] args){
Scanner reader=new Scanner(System.in);
int a=reader.nextInt();
int b;
A c=new A();
b=c.f(a);
System.out.println(b);
}
}
class A{
int f(int a) {
if(a==1)
return 1;
else
return a*f(a-1);
}
}