Skip to content
Snippets Groups Projects
Commit f7fee5fa authored by Vojtěch Michal's avatar Vojtěch Michal
Browse files

Add factorial

parent 23126f4a
Branches master
No related tags found
No related merge requests found
......@@ -3,5 +3,13 @@ package cz.cvut.fel.pjv;
public class Main {
public static void main(String[] args) {
System.out.println("Hello, World!");
public class Factorial {
public int factorial(int n) {
if (n==1) return 1;
return n * factorial(n - 1);
}
}
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment