Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /** @author Otto Sabart - Seberm
- */
- public class faktorial {
- public static void main(String[] argv) {
- if (argv.length <= 0) {
- System.out.println("chybi parametr");
- System.exit(0);
- }
- System.out.println(faktorial.faktorial(Integer.valueOf(argv[0])));
- }
- public static int faktorial (int n) {
- int x = 1;
- if (n != 0)
- x = n * faktorial(n - 1);
- return x;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement