задача 8.Factorial Division къде може да е причината да дава 70 точки
Здравейте ,
Задачата е :
Read two integer numbers. Calculate factorial of each number. Divide the first result by the second and print the division formatted to the second decimal point.
Examples
| Input | Output | 
 | Input | Output | 
| 5 2 
 | 60.00 | 
 | 6 2 | 360.00 
 | 
Решението ми е:
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int firstDigit=Integer.parseInt(sc.nextLine());
        int secondDigit=Integer.parseInt(sc.nextLine());
        System.out.printf("%.2f",1.0*factorial(firstDigit)/factorial(secondDigit));
    }
    static int factorial(int digit){
        int fact=1;
        for (int i=2;i<=digit;i++){
            fact=fact*i;
        }
        return fact;
    }
}
Какво пропускам за да ми дава три грешни отговора (съответно 70 точки)?
Благодаря, явно тук е бил ключа за бараката:)