/media/sda-magnetic/david/Dok-15-2023-11-27/fernuni-hagen/cs-i-ii/old-cs-2-03/java-new/2020-11-12-01/Faculty.java


public class Faculty {
    public static void main (String [] args) {
        int i;
        int f;
        int n;
        
        try {
            n = Integer.parseInt (args[0]);
        
            for (i = 1, f = i;  i <= n;  i++)
                f = f*i;
            
            System.out.println (Integer.toString(f));
        }
        catch (ArrayIndexOutOfBoundsException e) {
            System.out.println ("You have not given the neccessary number of arguments");
        }
        catch (NumberFormatException e) {
            System.out.println ("You have not given the neccessary type of arguments");
        }
            
    }
}