public static void main(String[] args){
Scanner s = new Scanner(System.in);
System.out.println("input number:");
Integer sum = 1;
while (true) {
Integer i = s.nextInt();
if (i<0 || i>10) {
System.err.println("invalid number");
break;
}else {
for (int j = 1; j < i+1; j++) {
sum = sum *j;
}
System.err.println(sum);
sum = 1;
}
}
}