Advertisement
Guest User

Untitled

a guest
Oct 15th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. public class Main {
  2. static int counter=0;
  3. static long binomi(int n, int k) {
  4.  
  5.  
  6.  
  7. if ((n == k) || (k == 0)) return 1;
  8.  
  9. if(k==1 || (k==n-1)) return n;
  10. else
  11. {
  12. counter++;
  13. return binomi(n - 1, k) + binomi(n - 1, k - 1);
  14. }
  15. }
  16.  
  17. public static void main(String[] args) {
  18.  
  19. System.out.println(binomi(200,5));
  20. System.out.println("ilosc wywolan " +counter);
  21. }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement