Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.15 KB | None | 0 0
  1. fn factorial<T>(t: T) -> T{
  2. if t < 2 {
  3. 1
  4. } else {
  5. t * factorial(t - 1)
  6. }
  7. }
  8.  
  9. fn main() {
  10. println!("{}", factorial(5));
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement