fork download
  1. #include <vector>
  2. using namespace std;
  3.  
  4. bool czyjest(vector<int>& a, const int& b)
  5. {
  6. vector<int>::iterator it;
  7. for(it=a.begin();it!=a.end();it++)
  8. {
  9. if(*it==b) return true;
  10. }
  11. return false;
  12. }
  13.  
  14. int main()
  15. {
  16. vector<int> a(3);
  17. a[0] = 5;
  18. a[2] = 5;
  19. a[1] = 5;
  20. int b = 10;
  21. czyjest(a, b);
  22.  
  23. return 0;
  24. }
Success #stdin #stdout 0.01s 2852KB
stdin
Standard input is empty
stdout
Standard output is empty