Advertisement
Fenrir112

F# %u043A%u043E%u043C%u0431%u0438%u043D%u0430%u0442%u043E%u0440%u0438%u043A%u0430

Dec 4th, 2013
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.22 KB | None | 0 0
  1. let rec fact x =
  2.     match x with
  3.     | 0 -> 1
  4.     | _ -> x * fact (x - 1)
  5.  
  6. let combination M N =
  7.     fact M / (fact N*(fact (M-N)))
  8. let a = combination 4 2
  9.  
  10. printf "%A" ("Число сочетаний=")
  11. printfn "%A\n" (a)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement