SHARE
TWEET

Untitled

a guest Feb 22nd, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. use std::iter::Product;
  2. use std::ops::RangeInclusive;
  3.  
  4. fn factorial_iterative<O, T>(m: T, n: T) -> O
  5. where
  6.     O: Product<T>,
  7.     RangeInclusive<T>: Iterator<Item = T>,
  8. {
  9.     let ret = (m..=n).product();
  10.     return ret;
  11. }
  12.  
  13. fn main() {
  14.     println!("{}", factorial_iterative::<i32, _>(2, 3));
  15. }
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