SHARE
TWEET

Untitled

a guest Oct 21st, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. fn main() {
  2.     println!("{}", going(10));
  3. }
  4.  
  5. fn going(n: i32) -> f64 {
  6.     let part_f = |x: i32, y: i32| -> i32 {
  7.         (x..=y).fold(1, |acc, c| acc * c)
  8.     };
  9.     (1..=n).fold(1f64, |acc, c| {
  10.         println!("{}", acc);
  11.         acc * (1 / part_f(c, n)) as f64
  12.     })
  13. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top