Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class ThirdClass {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- int factorialNum = Integer.parseInt(input.nextLine());
- int divideNum = Integer.parseInt(input.nextLine());
- calculations(factorialNum,divideNum);
- }
- static void calculations (int a,int b){
- int facNum = 1; //i*i-1 //20 * 3
- for (int i = a; i >= 1; i--) { //5*4*3*2*1;
- facNum = facNum*i;
- }
- double divNum = (double)(facNum/b);
- System.out.printf("%.2f",divNum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement