fork(1) download
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <array>
  4. using namespace std;
  5.  
  6. int main() {
  7. // your code goes here
  8. int arr[]={2,3,5,7,11,13,17,19,23};
  9. bool s=std::find(std::begin(arr), std::end(arr), 6) != std::end(arr);
  10. std::cout << s;
  11. if (s) {
  12. std::cout << "Element found";
  13. } else {
  14. std::cout << "Element not found";
  15. }
  16. return 0;
  17. }
Success #stdin #stdout 0.01s 5532KB
stdin
Standard input is empty
stdout
0Element not found