Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn factorial<T>(t: T) -> T{
- if t < 2 {
- 1
- } else {
- t * factorial(t - 1)
- }
- }
- fn main() {
- println!("{}", factorial("Hello world"));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement