Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <vector>
- #include <algorithm>
- using namespace std;
- int main()
- {
- int IN;
- cout << "Enter new element\n\n";
- cin >> IN;
- vector<int> arr;
- arr.push_back(3);
- arr.push_back(5);
- vector<int>::iterator arrIter;
- int inkr = 0;
- for (arrIter = arr.begin(); arrIter < arr.end(); ++arrIter)
- {
- if (IN < *arrIter)
- {
- ++inkr;
- }
- }
- int inkr1;
- inkr1 = arr.size() - inkr;
- arr.insert(arr.begin() + inkr1, IN);
- cout << "All massive" << endl;
- for (arrIter = arr.begin(); arrIter < arr.end(); ++arrIter)
- {
- cout << *arrIter << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement