Advertisement
naskedvi

S2 - zad.13

Mar 8th, 2014
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. int f(std:: vector<int> v)
  5. {
  6. for(int x: v)
  7. {
  8. if(x%2==0)
  9. {
  10. return true;
  11. break;
  12. }
  13.  
  14. else return false;
  15. }
  16. }
  17.  
  18. int main()
  19. {
  20. std:: cout<< "Unesite broj clanova niza: ";
  21. int n;
  22. std:: cin>> n;
  23. std:: vector<int> v(n);
  24. for(int x:v)
  25. std:: cin>> x;
  26.  
  27. if(f(v))
  28. std:: cout<< "Ima parnih brojeva!";
  29. else
  30. std:: cout<< "Nema parnih brojeva!";
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement