Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int zahlen[] = { 1, 3, 37, 3, 5, 17, 2, 8, 20, 15 };
  8. vector<int> zahlenVec;
  9. for (int i = 0; i < 10; ++i) {
  10. zahlenVec.push_back(zahlen[i]);
  11. }
  12. vector<int>::iterator Iter;
  13. for(Iter=zahlenVec.begin(); Iter!=zahlenVec.end(); ++Iter){
  14. if(*Iter%2==0)
  15. cout << *Iter << " ";
  16. }
  17. return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement