import java.util.Scanner;
public class JPA305 {
static Scanner keyboard = new Scanner(System.in);
public static void main(String[] args) {
test();
test();
test();
}
public static void test() {
int n;
int tmp;
System.out.print("Please enter one value:");
n=keyboard.nextInt();
if(n<=10&&n>=1){
tmp=1;
for(int i=1;i<=n;i++)
{
tmp=tmp*i;
}
System.out.println(n+"!:"+tmp);
}
else{
System.out.println("Error, the value is out of range.");
}
}
}
沒有留言:
張貼留言