daily pastebin goal
54%
SHARE
TWEET

Untitled

a guest Feb 17th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. fn has_even<T0, RT>(numbers: T0) -> RT {
  2.     for num in numbers {
  3.         if num % 2 == 0 {
  4.             return true;
  5.         }
  6.     }
  7.     return false;
  8. }
  9. fn main() {
  10.     let vec = vec![1, 9, 2, 5];
  11.     let even_exists = has_even(vec);
  12.     println!("{:?} {:?} ", "Has even number", even_exists);
  13. }
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