Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Factorials {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int num = scanner.nextInt();
- int count = scanner.next().length();
- int result = 1;
- while (num > 1) {
- result = result * num;
- num -= count;
- }
- System.out.println(result);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement