code.cpp 211 B

123456789
  1. /* Write a function to check if an
  2. * array contains a particular number.
  3. */
  4. bool check(std::vector<int> arr, int el) {
  5. for(int i = 0;i<arr.size();i++){
  6. if(arr[i] == el){return true;}
  7. }
  8. return false;
  9. }