Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::iter::Product;
- use std::ops::RangeInclusive;
- fn factorial_iterative<O, T>(m: T, n: T) -> O
- where
- O: Product<T>,
- RangeInclusive<T>: Iterator<Item = T>,
- {
- let ret = (m..=n).product();
- return ret;
- }
- fn main() {
- println!("{}", factorial_iterative::<i32, _>(2, 3));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement