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