import java.util.Scanner;
public class Factorial {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Введите число: ");
int n = scanner.nextInt();
int factorial = 1;
for (int i = 1; i <= n; i++) {
factorial *= i;
}
System.out.printf("%d! = %d", n, factorial);
}
}
import java.util.Scanner;
public class Factorial {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Введите число: ");
int num = input.nextInt();
long fact = 1;
for (int i = 1; i <= num; i++) {
fact *= i;
}
System.out.println("Факториал числа " + num + " равен " + fact);
}
}