Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- static int counter=0;
- static long binomi(int n, int k) {
- if ((n == k) || (k == 0)) return 1;
- if(k==1 || (k==n-1)) return n;
- else
- {
- counter++;
- return binomi(n - 1, k) + binomi(n - 1, k - 1);
- }
- }
- public static void main(String[] args) {
- System.out.println(binomi(200,5));
- System.out.println("ilosc wywolan " +counter);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement