Advertisement
Guest User

Untitled

a guest
Feb 28th, 2020
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Factorials {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. int num = scanner.nextInt();
  8. int count = scanner.next().length();
  9. int result = 1;
  10.  
  11. while (num > 1) {
  12.  
  13. result = result * num;
  14. num -= count;
  15. }
  16. System.out.println(result);
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement